Repository navigation
Recorded queries and the name cache (#149, third part) - #162
Merged
Merged
Conversation
The seven world queries record each visit with the caller's answer and are asked again on replay with the same answers, every visit compared; a query filter's id and name tag its caller; the player keeps the frame's queries and hits. Records go in under the recording's lock, so queries from several threads stay whole. Names are interned once per world under the reference's 32-bit hash (a collision takes the next free id); bodies and shapes hold ids, and the snapshot (version 2) carries the cache once.
…ing it A macOS runner's calling thread finished all 10,000 items alone in eight runs in a row: the check asked whether a pool thread wakes before the calling thread could finish, which is the system's scheduling. The calling thread's first block now gives the pool up to two seconds to take a block, so the check holds what it means: the pool joins in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The third and last part of #149: the recorded world queries and the name cache, as the reference's
recording*.candname_cache.chave them. With #160 (snapshot) and #161 (recording and replay), this covers all of #149.Closes #149.
Queries
overlap_aabb,overlap_shape,cast_ray,cast_ray_closest,cast_shape,cast_mover,collide_mover. Each record carries its arguments, every visit with the caller's answer, and the tree's work._internalbody, so a world that is not recording runs exactly the code it ran before.QueryFiltergains the reference'sidandname. A tagged query is preceded by a tag record holding the key: the reference's 64-bit FNV of the id and name. The id and name go once each into a tag table after the geometry.player_frame_query_count,player_frame_queryandplayer_frame_query_hit, the reference'sb3RecQueryInfoandb3RecQueryHit. Each query carries its caller's key, id and name, its bounds, and a cast mover's fraction.Name cache
name_id, and the world keeps each name once in abasics.NameCache.b3Hash32; the test pins the values from the reference's own function compiled in C.name_idwhole, and loading refuses any id the cache does not hold.Tests
test_recording.ae, 152 checks. The reference's tests:test_threads.ae. Four threads querying a recording world: every record whole (18,000 of them) and the replay asking them all again alike.test_basics.ae. The reference's CacheUnit, plus collisions, loading and refusals.Not ported: the reference's DebugShapeCallbacks subtest, since aephysics has no debug-shape callbacks on its world def.
Pins
Aether 0.796.0 and aeb v0.325, both the latest releases. The whole gate passed locally, golden trace included.