raptop changed the topic of #principia to: READ THE FAQ: http://goo.gl/gMZF9H; The current version is Fréchet. We currently target 1.5.1, 1.6.1, and 1.7.x. <scott_manley> anyone that doubts the wisdom of retrograde bop needs to get the hell out | https://xkcd.com/323/ | <egg> calculating the influence of lamont on Pluto is a bit silly… | <egg> also 4e16 m * 2^-52 is uncomfortably large
<discord->
Got. — Yeah, the problem is not orbit mechanism.
<discord->
Got. — In stock systems I think the most obvious inaccuracies will be for the comms network, thermal calcs and solar panel output.
<discord->
Got. — But TBH, those problems appear as soon as the timestep gets higher than 20-30% of the fastest involved vessel orbit period.
<discord->
Got. — For a vessel in LEO orbit, that mean at ~15/30 min timestep, about 100 000x timewarp speed
<discord->
egg. — > the problem is not orbit mechanism
<discord->
egg. — Well, precessions can be quite fast
<discord->
egg. — (but again, we should have an API anyway, so this will resolve itself eventually)
<discord->
egg. — note that @Sir Mortimer’s solution is "use the `Orbit` to figure out where the vessel was between game frames", so it is by definition correct in stock (and has whatever resolution he wants)
<discord->
Got. — Yep, I agree, but there is a point where we will hit a brick wall in terms of processing power.
<discord->
Got. — In the end, if you do large steps but then repeat most of the calculations you are doing in it in hundreds of substeps, that becomes quite counter-productive.
<discord->
Got. — You would just be better by not doing the large main steps in the first place...
<discord->
Got. — Unless you are doing calculations that can be considered to stay approximately true over the course of several orbits.
<discord->
Got. — In that case, you do them for a single orbit period and use them as an analytical result, and update them continuously in a separate thread as frequently as your processing power allow.
<discord->
Got. — This way, at high timewarp speeds, you get a less precise simulation, but at least not a totally random one.
<discord->
Got. — Of course, that much easier said than done 😛
<discord->
egg. — eh
<discord->
egg. — there can be quite a bit of margin, depending on how fast you make the check
<discord->
egg. — and then we can try to be smart and think about continuity and interpolation
<discord->
egg. — instead of discrete checks
<discord->
egg. — but also, it’s OK to reach a brick wall !
<discord->
egg. — it’s fine !
<discord->
egg. — Principia has that
<discord->
egg. — if you warp too fast, I will eat your CPU
<discord->
egg. — because I just do the same calculation faster, I don’t really have a choice
<discord->
egg. — and eventually I run out of room to make it faster, and that is fine
<discord->
Got. — Well, depending on what you do, the brick wall can comes quite early...
<discord->
Got. — Imagine if we were enforcing proper (read accurate) body occlusion checking for the whole comms network...
<discord->
egg. — yeah, we might need to be a little bit smart
<discord->
egg. — the obvious thing would be to use an adaptive stepsize for instance
<discord->
egg. — if you can express your condition as f(t) > 0, you can tune the step at which you evaluate f based on f′, and find where f crosses 0 either way
<discord->
egg. — plenty of classic techniques to deal with that
<discord->
egg. — but as a point of comparison, Principia with RSS works with a 10 s stepsize
<discord->
egg. — and for every LEO sat, every 10 s, it will compute the gravitational attraction from all planets + the full extended-body gravitational field of the Earth (degree and order 10)
<discord->
Pteropodidae. — @egg: Just curious, have you tried the coz profiler on Principia?
<discord->
egg. — we have benchmarking, we know where we spend time
<discord->
egg. — the issue isn’t so much finding that out as knowing what to do about it, programming smartness doesn’t materially change much here
<discord->
Pteropodidae. — Yeah, I saw the benchmarks
<discord->
Pteropodidae. — Well, the benchmarking code
<discord->
Pteropodidae. — Coz just claims to look at things a bit differently and so can find hot spots traditional profilers miss
<discord->
Pteropodidae. — But as you said, if you already know where the hot spots are then that won't help much
<discord->
egg. — yeah most nontrivial performance improvements are « rewrite the thing with a completely different approach over the next year » at this point :-p
<discord->
Pteropodidae. — rip
<discord->
Pteropodidae. — Do you run benchmarks on Windows only? Or do you support running them on all platforms?
<discord->
egg. — in theory they should work on other platforms, but again this is mostly irrelevant
<discord->
egg. — what matters is what kind of integration method you use, not whether the assignment gets hoisted out of the loop
<discord->
Pteropodidae. — That's fair
<discord->
Pteropodidae. — And the integration method is tightly controlled to avoid floating-point errors, right?
<discord->
egg. — while properly handling floating point arithmetic is a concern when implementing an integrator, what dominates unless you screw up is *truncation error*
<discord->
egg. — i.e., the error due to the finite step size
<discord->
Pteropodidae. — Sorry, sorry
<discord->
Pteropodidae. — Not my area of expertise 😦
<discord->
egg. — (if you do screw up you can get roundoff accumulation piling up and dwarfing everything, but a properly-written integrator has an error that is basically the same as it would have if you had infinite precision)
<kmath>
<eggleroy> Double-double sum vs. ill-conditioned compensated summation in multistep integrators: hitting the floor vs. going u… https://t.co/0C7k1P7sUm
<discord->
Pteropodidae. — This is definitely way above my pay grade
Wetmelon has quit [Ping timeout: 189 seconds]
<discord->
Got. — Yup, there are probably (too clever for me) solutions for all those problems :)
<discord->
Got. — This said, it seems to me that in a lot of situations you just can't predict f(t) or find a good enough analytical first estimation...
<discord->
Got. — For example, in the context of kerbalism radiation, I fail to see any way to predict if and for how long you're going to pass trough a radiation belt for any given orbit.
<discord->
Got. — in the end discrete fixed timestep evaluation has the advantage of being able to catch everything at once.
<discord->
Got. — Again in kerbalism, apart from the well known sunlight/shadow evaluation issue, there is also thermal and radiation impact from surrounding bodies, belts radiation, time spent in various situations (belts, biomes passed over...)
<discord->
Got. — Seems to me that evaluating from another thread a fixed-step per-vessel-orbit dataset for all that would allow to get reasonable approximations (which would anyway be better that the random data we currently use), with a fixed performance overhead regardless of timewarp speed.
Wetmelon has joined #principia
<discord->
egg. — yeah but it gets really hard to avoid correlations with periodic orbits
<discord->
egg. — it should not be that hard to find transitions in and out of the shade, for instance
<discord->
egg. — you do have to walk along the orbit with a sufficiently small timestep that you don’t miss it entirely
<discord->
egg. — but « sufficiently small » here is pretty big
<discord->
Got. — > it gets really hard to avoid correlations with periodic orbits
<discord->
Got. — Not sure I follow ?
<discord->
egg. — sample every 3600 s on a 3601 s orbit, you will think that it spends many hours in the shade
<discord->
egg. — but actually it was basking in the sun every hour
<discord->
egg. — ah,
<discord->
egg. — > per-vessel-orbit
<discord->
egg. — hm
<discord->
Got. — ha, ok, well in any case I was thinking quite small steps, probably in the minute range.
<discord->
Got. — Since that method involve having a thread dedicated to continuously crunching that data, I'm guessing we could go pretty low.
<discord->
Got. — Since in the end, you just loose precision by having the data of orbit n-x being used for orbit x
<discord->
Got. — But I guess you can scale down based on the the vessel orbital period ?
<discord->
egg. — I really dislike the idea of aiming for a fixed perf. overhead regardless of timewarp speed
<discord->
egg. — because it makes thing exceedingly hard to debug
<discord->
egg. — or to reproduce
<discord->
egg. — things end up depending on the way people timewarped
<discord->
egg. — and again, all of these calculations can be done pretty cheap
<discord->
Got. — Well, I don't say it's ideal. I say it would be better than what we are currently doing, which is complete random garbage
<discord->
egg. — yeah, random garbage is not great
<discord->
egg. — horribly slow is not great, but at least it is reproducible :-p
<discord->
egg. — and smart enough to not grind things to a halt should be feasible
<discord->
Got. — > all of these calculations can be done pretty cheap
<discord->
Got. — well, it make sense from your C++ magician and advanced math aware POV :P
<discord->
Got. — In my case, for the few substepping experiments I made, just trying to get sun occlusion and thermal data was putting KSP to a standstill.
<discord->
egg. — at what stepsize
<discord->
Got. — something like one minute
<discord->
egg. — how are you implementing the occlusion?
<discord->
Got. — basic sphere-ray vector math. but that part was quite fast, it was more the thermal calcs.
<discord->
Got. — Getting the positions of everything at a given UT is quite fast using the KSP methods, but in the end it adds up too...
<discord->
Got. — And I was probably doing all that in suboptimal data structures too...
<discord->
Got. — But the real issues were when I tried to get the biome passed over.
<discord->
Got. — Anyway i remember ending in the 100ms+ range for substepping at max stock timwarp speed
<discord->
egg. — something sounds horribly wrong if doing O(number of vessels) calculations at a 1 min step is too slow
<discord->
egg. — considering that Principia does that at 10 s
<discord->
egg. — (with some nontrivial calculations as well)
<discord->
egg. — if you do something part-level you might have a bad time
<discord->
egg. — (assuming that you have ~100 parts per vessels, ballpark)
<discord->
egg. — (assuming that you have ~100 parts per vessel, ballpark) (edited)
<discord->
DRVeyl. — For reference, there's a built-in occlusion check call in stock CommNet. Each body registers an Occluder, tests if a ray from A to B hits one or not.
<discord->
Got. — Honestly I don't really remember what I was doing, but no there wasn't any partcount dependant calcs.
<discord->
Got. — I think it was more or less acceptable until I added the biomes getting part
<discord->
egg. — yeah that might get nasty
<discord->
egg. — or s/might/definitely will/ :-p
<discord->
DRVeyl. — What, not fun describing the ground track? 😉
<discord->
egg. — the biomes have horrible horrible shapes that you can't really do maths to
<discord->
DRVeyl. — Also that.
<discord->
DRVeyl. — (Ground track probably isn't bad, you have the body position and orientation and vessel position.)
<discord->
egg. — yeah ground track, or azimuth/elevation from a point on the surface, etc., all of that should be cheap
<discord->
egg. — actually looking at a biome map, nope
<discord->
DRVeyl. — Hm. Actually, wonder if you can do edge detection on it, then turn those into more reasonably-shaped closed polygons.
<discord->
Got. — Yeah, I remember copy-pasting the biome getting code to try to optimize it a bit, but there is no way around it, you just have to iterate over the huge image array
<discord->
egg. — yeah that is death incarnate
<discord->
DRVeyl. — But it doesn't change. You should only need to iterate over it once. Am I wrong that it should reduce to closed shapes?
<discord->
egg. — @DRVeyl either polygons or circles, if you can admit overlapping boundaries
<discord->
egg. — circles are cones in the context of "over a biome" which is really nice to work with
<discord->
egg. — though covering the biome with circles might be a bit too interesting
<discord->
egg. — why is it 3:30
<discord->
Got. — Yeah, we should definitely go to sleep
<discord->
egg. — well, you should pump
<discord->
egg. — while sleeping
<discord->
Got. — the pump is specially conceived, I only have to dream that I'm pumping 🙂
<discord->
Got. — So, good night folks, interesting discussion over here, as always
<discord->
egg. — (hm, cones are nice for "over a biome" but what if you want "seeing a biome at an elevation greater than x")
<discord->
DRVeyl. — I think that is just a cone with a shifted apex.
Wetmelon has quit [Ping timeout: 204 seconds]
<discord->
egg. — probably
<discord->
egg. — though then you need some design thinking around whether you care about seeing the biome at that elevation, or seeing the biome cross-track within the swatch at that elevation, etc., etc.
<discord->
egg. — though then you need some design thinking around whether you care about seeing the biome at that elevation, or seeing the biome cross-track within the swath at that elevation, etc., etc. (edited)
Wetmelon has joined #principia
<discord->
egg. — getting quite foggy here
<discord->
egg. — wasn't I supposed to sleep
<discord->
DRVeyl. — Yes, you were. (Nite!)
<discord->
egg. — 🥚💤
egg|laptop|egg has joined #principia
egg|laptop|egg has quit [Remote host closed the connection]
egg|laptop|egg has joined #principia
<discord->
Pteropodidae. — egg, just to make sure I'm understanding the plots you linked earlier
<discord->
Pteropodidae. — Those show how error decreases as iterations per step increase?
<discord->
Pteropodidae. — Er
<discord->
Pteropodidae. — Never mind, apparently he's sleeping
<discord->
Pteropodidae. — Er, slight correction to my earlier question
<discord->
Pteropodidae. — Actually, never mind
<discord->
Pteropodidae. — I think I get it
<discord->
Pteropodidae. — The roundoffs mentioned there are the floating-point errors I originally mentioned as opposed to truncation error?
<discord->
Pteropodidae. — And ill-conditioned means the relative error is large?
* discord-
Pteropodidae. — regrets not taking a numerical analysis class when the opportunity was available_
<discord->
Pteropodidae. — Part of it is I'm never confident that I'm googling the right things
<discord->
Pteropodidae. — And because I'm trying to link it to my original wording, which may or may not have been correct
<discord->
Pteropodidae. — Thanks though
<discord->
egg. — "floating-point error" is nonspecific and typically not a very useful term
<discord->
egg. — (and all too often it means "error analysis is hard but floating point arithmetic is a good bogeyman")
<discord->
Acer_Saccharum. — unless you're doing something really weird floating point errors shouldn't be the issue
<discord->
egg. — well
<discord->
egg. — there are *many* places in Principia where we have to do careful things to avoid issues of that sort
<discord->
egg. — arguably Principia is really weird
<discord->
Acer_Saccharum. — I wouldn't dispute that at all
<discord->
egg. — but error analysis is important
<discord->
Acer_Saccharum. — at least you can generally engineer your way around floating point errors, whereas other errors have a more mathematical basis
<discord->
egg. — aaand nope.
<discord->
Acer_Saccharum. — I could very well be totally and completely wrong
<discord->
egg. — "floating point errors", whatever that means, is typically about roundoff error and its amplification by ill-conditioned operations
<discord->
egg. — maths is all you have
<discord->
Acer_Saccharum. — at least you can generally engineer your way around floating point (I mean rounding and finite-precision things) errors, whereas other errors have a more mathematical basis (edited)
<discord->
egg. — sure you can extend the precision, but doing so beyond what you have natively does require some understanding of numerical analysis, but mostly you want to move the ill-conditioned bits around
<discord->
egg. — and that is all about formally rewriting your functions in clever ways
<discord->
Acer_Saccharum. — I shouldn't keep you up much longer, the point I was trying and failing to make was what you just said, you can extend the precision as far as you want, but that isn't really a solution in and of itself
<discord->
egg. — as an exercise, consider the question of computing the angle between two vectors
<discord->
egg. — it is a good exercise
<discord->
Acer_Saccharum. — the method that I've used in the past has been taking the arctangent of the norm of the cross product of the vectors and their dot product
<discord->
Acer_Saccharum. — no clue at all how good of a method that is from a numerics perspective
<discord->
egg. — yes, that is a good method
<discord->
egg. — the question for you is then why arc cos of the dot product divided by the product of norms, or arc sin of the norm of the cross product divided by the product of norms, are bad
<discord->
egg. — and how bad
<discord->
Pteropodidae. — o_O That's a new method for me
<discord->
egg. — > that is all about formally rewriting your functions in clever ways
<discord->
egg. — oh a trivial example of that
<discord->
egg. — compute x^2 - y^2
<discord->
Pteropodidae. — Cancellation?
<discord->
egg. — cancellation is a special case of things being ill-conditioned, yes, *but*
<discord->
egg. — Sterbenz's lemma
<discord->
Acer_Saccharum. — well for small vectors the division by the product of norms seems like it might get nasty precision-wise
<discord->
egg. — @Acer_Saccharum that is not the issue
<discord->
egg. — division is very well behaved
<discord->
egg. — @Pteropodidae so, re. cancellation, if x is near y, x - y is *exact*
<discord->
Acer_Saccharum. — well what do I know, I'm only halfway through an introductory numerical methods class as a non-math major
<discord->
egg. — so it is not the subtraction that induces error
<discord->
egg. — what it does is make it so only the error remains, in a sense
<discord->
egg. — or, if you want to look at it from a more analytic perspective, it amplifies the error
<discord->
egg. — so in x^2 - y^2, with x and y close to each other, the squarings are perfectly good operations
<discord->
egg. — they give you half an ULP on their result
<discord->
egg. — but the subtraction then leaves you with a number which may be as small as that ULP, leading to an arbitrarily big relative error
<discord->
egg. — in contrast
<discord->
egg. — compute it as (x+y)(x-y)
<discord->
egg. — for x close to y, x-y is exact, x+y has half an ULP on its result
<discord->
egg. — then you have a product, which is a well-conditioned thing
<discord->
egg. — you get an ULP on the overall result
<discord->
egg. — i.e., x^2 - y^2 could lose all bits of precision, (x+y)(x-y) loses only one bit
<discord->
Pteropodidae. — This is also why the more traditional methods of finding the angle between two vectors is not a good idea?
<discord->
egg. — it also has to do with conditioning, yes
<discord->
Pteropodidae. — This is also why the more traditional methods of finding the angle between two vectors are not a good idea? (edited)
<discord->
Pteropodidae. — Hm
<discord->
Pteropodidae. — Googling is proving to be enlightening
<discord->
egg. — you compute a cosine, if it is close to -1 or 1, a very small error in the cosine will lead to an arbitrarily large error in the arccosine
<discord->
Acer_Saccharum. — and the same would therefore be true for the asin method, since that also has vertical-in-the-limit places
<discord->
egg. — yup, but instead of screwing up near null or flat angles like the arccos method, arcsin will screw up near right angles
<discord->
egg. — in contrast, if you look at arctg, its graph does not get very steep
<discord->
Acer_Saccharum. — it appears well-behaved everywhere
<discord->
Pteropodidae. — scicomp.SE says that cross product/dot products can also suffer from cancellation?
<discord->
egg. — so even if you used the one-parameter arctg (the two-parameter one does some discrete magic but ultimately is just arctg y/x), arctg sin/cos would be the way to go
<discord->
egg. — well a dot product is product followed by a sum
<discord->
Pteropodidae. — Seems to suggest something using a variant of Heron's formula
<discord->
Acer_Saccharum. — I was in fact referring to the piecewise? 2-argument atan2 function
<discord->
egg. — ultimately "suffers from cancellation" is a fancy way of saying "things are being added and we don't control their sign"
<discord->
Pteropodidae. — No idea how correct that is
<discord->
Pteropodidae. — Ah
<discord->
egg. — @Acer_Saccharum yup, that is definitely the right choice; but in its absence it is amusing to note that dividing then arctg would do
<discord->
egg. — @Acer_Saccharum ultimately an atan2(y, x) is really just a call to atan(y/x) after a lot of special cases
<discord->
Acer_Saccharum. — yeah, it just does the whole +- pi radians for you after checking the sign of x
<discord->
Acer_Saccharum. — yeah, it just does the whole +- pi radians for you after checking the sign of x and y (edited)
<discord->
egg. — yeah, handling 0s, infinities, and NaNs differently, not signaling in the same way as the division would, etc.
<discord->
egg. — but the main path is just the normal atan behind a division
<discord->
Acer_Saccharum. — it'll actually give you a result for when x is zero
<discord->
egg. — well, so will atan(y/x)
<discord->
egg. — more interestingly, it will give you results when both are 0
<discord->
Acer_Saccharum. — am I missing something in thinking that there'd be an issue with arctan(y/x) as x--> 0- being different to arctan(y/x) as x--> 0+
<discord->
egg. — there's a branch cut
<discord->
egg. — that's why you have signed 0
<discord->
egg. — there's a branch cut in atan2 too
<discord->
Acer_Saccharum. — I do know that
<discord->
egg. — ah you mean that it doesn't fall in the same place
<discord->
Acer_Saccharum. — well would both not have the same physical meaning, in that an angle of -pi/2 and pi/2 between vectors has the same effect
<discord->
Acer_Saccharum. — well would both the 0- and 0+ cases have the same physical meaning, in that an angle of -pi/2 and pi/2 between vectors has the same effect (edited)
<discord->
Acer_Saccharum. — well I mean you define signed angle with the right-hand rule there is a distinction
<discord->
egg. — I am bad at this sleep thing
<discord->
egg. — 💤
<discord->
Acer_Saccharum. — has the sun risen yet?
<discord->
egg. — no, it's 5:20
<discord->
Acer_Saccharum. — so dawn isn't that far off, I'll stop bothering you now
egg|laptop|egg has quit [Remote host closed the connection]
egg|laptop|egg has joined #principia
<discord->
Pteropodidae. — Sorry for those poorly-timed questions 😦
<discord->
Pteropodidae. — And good night!
<discord->
Pteropodidae. — (morning?)
egg|laptop|egg has quit [Ping timeout: 190 seconds]
<discord->
Standecco. — the best 250+ messages conversation I've ever read
egg|cell|egg has quit [Ping timeout: 189 seconds]
egg|cell|egg has joined #principia
egg|cell|egg has quit [Read error: Connection reset by peer]
egg|cell|egg has joined #principia
egg|cell|egg has quit [Read error: Connection reset by peer]
egg|cell|egg has joined #principia
egg|laptop|egg has quit [Remote host closed the connection]
<discord->
Sir Mortimer. — To reiterate the converation, I'm pondering the possibilities to maybe improve the performance of a biome lookup. It's not going to be simple.
egg|cell|egg has quit [Ping timeout: 190 seconds]
egg|cell|egg has joined #principia
egg|cell|egg has quit [Read error: Connection reset by peer]
egg|cell|egg has joined #principia
egg|laptop|egg has joined #principia
egg|laptop|egg has quit [Remote host closed the connection]
egg|cell|egg has quit [Ping timeout: 189 seconds]
egg|cell|egg has joined #principia
egg|cell|egg has quit [Ping timeout: 189 seconds]
egg|laptop|egg has joined #principia
<discord->
egg. — yeah biome lookup sounds like a mess
egg|cell|egg has joined #principia
egg|cell|egg has quit [Ping timeout: 190 seconds]
<discord->
Butcher. — What's the current issue?
<discord->
Butcher. — I've looked through the squad stuff in dotpeek and it's suboptimal I think.
<discord->
Sir Mortimer. — its borderline illegible, too, leaning towards the wrong side of that border.
<discord->
Sir Mortimer. — i think the bottom line of the discussion will be that we will still need to do some form of discrete subsampling, maybe with a variable sample step size, and just accept the remaining errors that this will still have. somehow I don't see an analytical approach that would work in the long run, especially with adding new variables to the simulation.
<discord->
egg. — well, the analytical approach lies in the whole "variable stepsize" thing
<discord->
egg. — but I think it is critical to retaining sanity that the behaviour be roughly independent of timewarp
<discord->
egg. — bear in mind that biomes are uniquely messy; if you look at the things discussed in that design page, most properties are geometrical, and thus much nicer to do maths to than biomes which are by definition an arbitrary image
<discord->
egg. — elevation angle, solar exposure, DOP, all are ultimately basic and cheap geometry
<discord->
Sir Mortimer. — what I mean is, you can calculate when an orbit will enter and leave the umbra, when it will be closest to the body and when it will be at given tresholds in relation to a point on the surface. but as soon as you add things like radiation belts that vary in size and intensity based on a scalar that we use as a sorry excuse for the solar cycle, or biomes, i somehow have my doubts that we will be
<discord->
Sir Mortimer. — so you can do it analytically if you don't include biomes. ever. at which point you will just have to live with some error.
<discord->
egg. — the question however whether biomes can be processed into something sane
<discord->
Sir Mortimer. — i thought about converting them into vectors, but that process itself will produce errors.
<discord->
egg. — of course
<discord->
egg. — but the fact that you can technically have single pixels of a biome in the middle of another is not necessarily something you want to spend too much time thinking about
<discord->
egg. — the question is not whether you will have errors or not
<discord->
egg. — obviously you will, in some form
<discord->
egg. — the question is whether you can constrain these errors, and whether you can make them deterministic
<discord->
egg. — and I think that last point, that the errors should be deterministic, is critical
<discord->
egg. — otherwise the fancy heuristics will fall on their face in a way that you will never be able to debug
<discord->
Butcher. — Ideally you shouldn't have single pixels of biomes, I agree that it occurs but its not desirable anyway.
<discord->
Butcher. — I did a bit of cleanup on the Earth biome recently because of this very issue.
<discord->
Standecco. — you could say that instead of being _over_ a biome, it's more important if said biome is visible at all
<discord->
Standecco. — so you take the biome map, extract a series of point at startup (ideally, a point for each biome larger than 2 pixels), then check if any of those points are visible
<discord->
Standecco. — maybe check which is closest?
<discord->
Standecco. — that has issues when the biome is really large, though
<discord->
Sir Mortimer. — i think not having an accurate biome evaluation would carry a long way. they could be partly substituded by waypoints on the surface if needed.
<discord->
Standecco. — even extracting 360x360 points would come a long way, I think
<discord->
DRVeyl. — I think egg is also saying that you can put some definitions on what the biome maps that you handle *well* look like, what biome maps will cause some errors, see how close or far you are to current maps... and then just make this fact known. "Hey, we can't handle properties like these. Can you make them look more like what we can handle?"
<discord->
egg. — or maybe you can subdivide space into cones from which the biome is visible, or something similarly clever
<discord->
Standecco. — isn't checking if a biome is larger than `predefined value` trivial?
<discord->
Standecco. — you could eliminate single pixel or 4x4 pixel biomes and such
<discord->
egg. — it definitely needs some throwing of brains at the problem but I think it is possible to have useful approximations
<discord->
egg. — @Standecco even downsampled, I just don’t think a grid on an equirectangular projection is a very useful representation of anything
<discord->
egg. — @Sir Mortimer but anyway, let’s not get too carried away ; I think your current approach of fixed-step downsampling is a good start to get something reproducible and sane, and then once you run into performance issue we can try using our brains
<discord->
egg. — I should make tea
<discord->
Standecco. — why is that? You project the biome map (with its n biome markers that you just calculated) onto the planet and then check if said markers are visible
<discord->
Standecco. — why is that? You project the biome map (with its `n` biome markers that you just calculated) onto the planet and then check if said markers are visible (edited)
<discord->
egg. — because it’s still massively inefficient
<discord->
egg. — you are computing cartographic coordinates, you have a projection whose higher density at the poles buys you nothing useful, and you still need a pretty large image if you want it to resemble the original
<discord->
egg. — as much as possible you want to preprocess for the problem you will be solving
<discord->
Sir Mortimer. — @egg yeah, subsampling will work for quite a while. if needed i can try to move that brick wall a little bit by using threads, too.
<discord->
Standecco. — well, translating the markers into points on the planet surface might be inefficient, but you can do that only once right?
<discord->
Standecco. — and you can account for the different density at the poles
<discord->
egg. — if that is biome visibility rather than being-above a biome, those structures are different
<discord->
Standecco. — and you can account for the different density at the poles when you sample your biome map (edited)
<discord->
egg. — @Standecco if you want to partition space into places from which areas are visible, checking the visibility of lots of points is woefully inefficient
<discord->
egg. — the problem here is not your preprocessing, it is the structure that you get
<discord->
egg. — it is still bad
<discord->
Sir Mortimer. — Cat vs. Stirling Engine
<discord->
Standecco. — @egg how would you structure it, if points are inefficient?
<discord->
Standecco. — @egg how would you structure it, if point visibility checks are inefficient? (edited)
<discord->
Sir Mortimer. — > hah, stirling engine on a mac charger 😄
<discord->
Sir Mortimer. — recycling the energy lost to heat! 🙂
<discord->
egg. — @Standecco I don’t know, I have not spent much time thinking about it :-p https://en.wikipedia.org/wiki/Quadtree comes to mind, since we are talking about a space partitioning problem
<discord->
egg. — probably not this specifically, but some form of hierarchical structure
<discord->
Sir Mortimer. — that at least would speed up biome lookup.
<discord->
Sir Mortimer. — actually the KSP implementation might be such that it has a similar effect
<discord->
egg. — I mean biome *lookup*, as in, "which biome are we in", should be pretty fast by just looking at the image (you have a massive lookup table at hand)
<discord->
Standecco. — right, how does ksp's own method hold up at fast time warp speeds?
<discord->
egg. — biome *visibility checks* are a nightmare without massive preprocessing
<discord->
Sir Mortimer. — @Standecco it was the most time consuming factor in the substepping implementation that Got has done for kerbalism a while ago
<discord->
Standecco. — so you're trying to completely reimplement that
<discord->
DRVeyl. — Which is weird since I don't imagine body.GetLatLonAlt should be that bad.
<discord->
Sir Mortimer. — no. I'm currently doing it for contracts only.
<discord->
Standecco. — I guess squad never bothered to try making something fast since their biome checks only matters when you activate your experiments
<discord->
DRVeyl. — Although I guess you need the body -at- the right stepped place.
<discord->
Standecco. — so you're trying to completely reimplement that check (edited)
<discord->
egg. — @DRVeyl I suspect KSP might be doing something dumb
<discord->
DRVeyl. — Hm. Weird. Wouldn't expect even a re-calc of body.GetLatLongAlt to be bad.
<discord->
Butcher. — Fast visibility check, render the biome mapped sphere for the planet, determine which colours you can see.
<discord->
egg. — maybe it doesn’t actually have the lookup table in a usable state
<discord->
egg. — if it need to mangle the image every time that would cause slowness
<discord->
Butcher. — Without using the gpu though...
<discord->
Standecco. — right, can't you use the gpu to check which biomes are visible?
<discord->
egg. — leave the poor GPU alone :-p
<discord->
Butcher. — Well part of the problem is that Squad doesn;t store the biome map as a texture.
<discord->
Standecco. — it seems like it would scale well for parallelization
<discord->
Butcher. — It stores it in cpu memory for faster cpu lookups.
<discord->
egg. — yes but precisely that should be nice for this purpose @Butcher
<discord->
Butcher. — Though obviously you can just load the texture itself (since I assume that's what they do for the biome overlay).
<discord->
egg. — the issue is what form it is kept in
<discord->
Standecco. — ok then move all biome maps to the L1 cache
<discord->
Standecco. — easy
<discord->
Sir Mortimer. — yah, sounds doable.
<discord->
egg. — anyway 🐴 , 🛒, etc.
<discord->
Butcher. — @Standecco On the GPU it would take microseconds, however getting the result back is the issue - that would need to wait a frame or so.
<discord->
Butcher. — @egg You're taking your horse shopping?
<discord->
egg. — you have a very wide vector unit at the end of a very long pipe
<discord->
Butcher. — A very long pipe.
<discord->
egg. — @Butcher nah, trying emoji-based puns about horses and carts
<discord->
egg. — I guess if I had a horse I could use it to go shopping
<discord->
Standecco. — @egg you could try riding your cat
<discord->
Standecco. — @Butcher is getting the results back so slow because of software limitations, or just because of the physical interface between the gpu and cpu being slow?
<discord->
Butcher. — The former in a manner of speaking.
<discord->
Butcher. — The interface between the GPU and memry is on the order of 5-10 GB/s typically.
<discord->
Butcher. — The issue you have is that the GPU is usually running about a frame or two behind the CPU - i.e. the CPU builds up a frame of work for the GPU and submits it, then the GPU consumes it. So your turnaround is at beast about 1-2 frames.
<discord->
Butcher. — The issue you have is that the GPU is usually running about a frame or two behind the CPU - i.e. the CPU builds up a frame of work for the GPU and submits it, then the GPU consumes it. So your turnaround is at best about 1-2 frames. (edited)
<discord->
Butcher. — Which is maybe 33ms at 60 fps, or more at lower frame rate.
<discord->
Butcher. — For biome visibility you'd do something like, draw the planet shaded with biomes only to a texture, use a compute shader to read the texture and determine which colours are present, write the colour presence info to a buffer, CPU reads the buffer.
<discord->
Pteropodidae. — If you want visibility, you could try something like an R-tree? Downsample the biome map to something relatively sparse, use the tree to find points within a certain radius of your ground position, and determine the biomes using those points?
<discord->
Pteropodidae. — Approximate visibility by assuming biomes within a certain radius of your ground position are visible
<discord->
Pteropodidae. — Not really sure about how accurate that would be though
<discord->
egg. — It’s a long way to the GPU / It’s a long way to go / It’s a long way to the GPU / To the widest float vectors / Goodbye vector FPU / Farewell ALU / It’s a long long way to the GPU / but my image’s due
<discord->
Pteropodidae. — Nor the performance
<discord->
Pteropodidae. — Big-O wise it's nice but I'm not sure how well that translates to real-world performance
<discord->
egg. — Anyway
<discord->
Pteropodidae. — Those also tend to work better for clustered data and a downsampled biome map isn't clustered
<discord->
egg. — we’ll cross the performance bridge when we get there
<discord->
Sir Mortimer. — @egg do you know of that invention where people somehow manage the artistic act of driving on a contraption with two wheels behind each others without falling over? I've seen kids doing it
<discord->
Butcher. — @Sir Mortimer Sounds like the devil's work.
<discord->
egg. — yeah there are a bunch of those devices here
<discord->
Sir Mortimer. — how far is it for that horse of yours? 5km?
<discord->
egg. — yeah
<discord->
Sir Mortimer. — pittoresque.
<discord->
Sir Mortimer. — also, get a drivers license. they're quite useful outside of big cities.
<discord->
egg. — yeah I have noticed
<discord->
Butcher. — I drove to work today, to pick up some stuff. Risky business being outside.
<discord->
egg. — just saw a police car patrolling the bike path
<discord->
Sir Mortimer. — oh which reminds me, you're not supposed to go out any more for sports, right? because those disciplined french ignored the rules?
<discord->
egg. — hm, I haven’t checked
<discord->
egg. — @Sir Mortimer govt website seems to say that you can still do sport individually or walk your dog, but no more than an hour a day and within 1 km of your house
<discord->
Sir Mortimer. — I've been staring at that cursor for 5 minutes now, unable to come up with anything meaningful to write there. I think I should go for a walk
<discord->
Sir Mortimer. — the crater island biome on eve is one of the smallest I know of. look at that for reference.
<discord->
egg. — Anyway, plenty of things to look at before biome performance
<discord->
egg. — DOP!
<discord->
egg. — @Sir Mortimer iirc you had experimented with a Transit-like contract? how did that come out?
<discord->
Pteropodidae. — Hrm
<discord->
Pteropodidae. — I was going to say maybe do something dumb like downsample the biome map into a grid and look in an NxN grid cell centered on the vessel's ground location when you want biome visibility
<discord->
Pteropodidae. — Not very accurate, but simple
<discord->
egg. — I don’t think spending much more time and brain cells on that question is useful at this point, especially since whatever is said will be forgotten by the point the issue arises
<discord->
Butcher. — I mean you could quantise the biome map down to a relatively coarse resolution but store all visible biomes in each cell of the map (as a bitfield or the like).
<discord->
DRVeyl. — For attachments... I vote "tassels."
<discord->
Sir Mortimer. — i handwaved the minimal pass duration to be able to get a fix tho.
<discord->
egg. — slightly confused at the radial velocity expressed in, uh, degrees per metre?!
<discord->
Sir Mortimer. — minute
<discord->
egg. — but even then that's an angular speed, not linear one
<discord->
egg. — the radial velocity is the derivative of the radius, which is a length
<discord->
egg. — so it's in m/s
<discord->
egg. — I think the constraint should be a notable *change* in radial velocity over the course of the pass
<discord->
egg. — but I need to check my notes
<discord->
Sir Mortimer. — actually i'm not sure that we a) talk about the same thing and b) any of those things is relevant to TRANSIT. as far as I can tell, it depends on a doppler shift, which requires a satellite to first get closer and later to get away again. the angle above the surface doesn't play a role in this.
<discord->
egg. — @Sir Mortimer radial velocity means the component of velocity towards/away from the ship
<discord->
egg. — i.e. a thing that moves circles you at a constant distance has 0 radial velocity
<discord->
Sir Mortimer. — ah. so i confused radial velocity with angular velocity 🙂
<discord->
egg. — confusion happens
<discord->
egg. — radial velocity is the thing that you see as Doppler shift
<discord->
egg. — so you want that to change over the pass, to detect a change in doppler shift
<discord->
egg. — and then I think you have subtleties with how high the satellite is leading to inaccuracies in different directions but I forget the specifics of that
<discord->
Sir Mortimer. — angular velocity might be relevant for a tundra satellite. there are huge ground stations with big dishes that need to point at the satellites, it would maybe make sense to require a max. angular velocity so that those dishes can actually track the damned thing
<discord->
egg. — yeah, angular velocity is relevant for anything that requires a tracking antenna
<discord->
egg. — e.g. you don’t want to track those where they are молния, *lightning*
<discord->
egg. — (which is where you don’t use them, in the south hemisphere)
<discord->
egg. — (to quote capderou, those orbits are chosen because they are slow in the north, but named because they are fast in the south, they should be called snail orbits instead)
<discord->
Butcher. — Eh, just make everyone use phased arrays. 😁
<discord->
egg. — орбита улитка
<discord->
Sir Mortimer. — anyway, i don't know if we actually need something that calculates the accuracy of the fix that can be obtained from a pass of a satellite. if it is not something the player can get an understanding of how it is calculated, i fear it will only lead to confused players
<discord->
egg. — true
<discord->
egg. — but Δradial velocity is the important bit
<discord->
Sir Mortimer. — i don't have the ∆ yet.
<discord->
Sir Mortimer. — wow
<discord->
egg. — that is mostly understandable (you want the siren on the satellite to goo weeeeeeeooouuuuuuuuuuuuu as it goes overhead :-p), and close enough
<discord->
Sir Mortimer. — why is your Δ different from my ∆
<discord->
egg. — mine is a delta because I am lazy
<discord->
egg. — yours is probably an increment sign
<discord->
Sir Mortimer. — alt+k on my keyboard -> ∆ there are also Ωµπ in the vicinity. looks greek
<discord->
egg. — ∆: U+2206 INCREMENT
<discord->
egg. — Δ: U+0394 GREEK CAPITAL LETTER DELTA
<discord->
egg. — also µ: U+00b5 MICRO SIGN
<discord->
Sir Mortimer. — well, apple done goofed then.
<discord->
egg. — and μ: U+03bc GREEK SMALL LETTER MU
<discord->
egg. — @Sir Mortimer not really
<discord->
egg. — you don’t have an entire greek alphabet with alt+stuff, just mathy things
<discord->
Sir Mortimer. — yeah but my mathy thing is more a poiny thing 😦
<discord->
egg. — so you want INCREMENT, semantically
<discord->
egg. — I only type delta because I have a greek keyboard and I am too lazy to look up the proper symbol
<discord->
lpg. — unicode goes higher than 2 for some things
<discord->
egg. — @Sir Mortimer note that Apple gives you omega probably for Ohm, because while there is a dedicated Ohm sign in Unicode, that one is deprecated
<discord->
Standecco. — ∆Δ is the least confusing way to use a Δ named variable; it's where you can't confuse Δ for ∆
<discord->
egg. — hm, unicode.org is having trouble today
<discord->
egg. — but other than that this is a list of fun things like that
<discord->
egg. — including I l 1, fwiw
<discord->
Butcher. — You people are monsters.
egg|laptop|egg has quit [Remote host closed the connection]
egg|cell|egg has quit [Ping timeout: 204 seconds]
<UmbralRaptop>
Δ∇
egg|cell|egg has joined #principia
egg|laptop|egg has joined #principia
<discord->
egg. — hm the relay bot has encoding issues
egg|cell|egg has quit [Ping timeout: 190 seconds]
egg|cell|egg has joined #principia
<discord->
Pteropodidae. — Is "psychohistory" in the Principia codebase named after the thing from the *Foundation* series?
<discord->
Pteropodidae. — Also, question about Principia's code
<discord->
Pteropodidae. — Erm
<discord->
Pteropodidae. — When computing trajectory predictions for flight planning purposes
<discord->
Pteropodidae. — ...I'm not really sure how to phrase my question, actually
egg|laptop|egg has quit [Remote host closed the connection]
<discord->
Pteropodidae. — I guess it boils down to "How does Principia's handling of vessels during a flight plan prediction differ from its 'normal' handling?"
<discord->
Pteropodidae. — I saw #2347 and wanted to see how much I could figure out on my own
<discord->
Pteropodidae. — I think I figured out how the flight planner gets its trajectory for segments with burns?
<discord->
Pteropodidae. — Something about using the ephemeris to integrate the vessel's trajectory, with the burn providing its own acceleration?
<discord->
Pteropodidae. — And the vessel's trajectory during "normal" gameplay is derived from the psychohistory?
<discord->
Pteropodidae. — But I'm not yet certain how the psychohistory is calculated
<discord->
Pteropodidae. — How off am I?
egg|cell|egg has quit [Ping timeout: 189 seconds]
<discord->
neph. — if I had to guess, it's the same thing with less stringent tolerances
<discord->
neph. — You'll accumulate more error in the predicted future than in the actual future, but it's faster to calculate. I don't know if it's actually a different solver or the same one with a bigger solution epsilon though. Knowing egg, I wouldn't be surprised if he wrote a different one for each application 🙂
<discord->
Pteropodidae. — > In addition, the integration method1 that we use for long-term vessel trajectories only works if the forces that it is applying depend solely on the position of the vessel, not its velocity; and it only has nice properties if these forces derive from a potential.
<discord->
Pteropodidae. — Which I suppose answers my question now that I think about it
egg|laptop|egg has joined #principia
<discord->
egg. — #2347 is, uh,
<discord->
egg. — well, at least those two are entertaining each other in that issue
<discord->
Pteropodidae. — Yeah, that guy has an *interesting* perspective
<discord->
Pteropodidae. — > become costless for only estimated less than 1000 lines of core codes xDDD
<discord->
egg. — **an** interesting ***approach*** to *formatting*__as__ _____well_____
<discord->
egg. — **an** __***interesting***__***approach*** to *formatting*__as__ _____well_____ (edited)
egg|cell|egg has joined #principia
<discord->
Pteropodidae. — At least the issue made for an interesting starting point for exploring the Principia codebase