Repository navigation
Conversation
1. `ElytraBehavior` needs a thread safe `BlockStateInterface` for the solver 2. Make `BlockStateOctreeInterface` thread safe
ZacSharp's 415acfcf, ported as it is: the cached (chunk, position) pair is a record behind a plain field, read once into a local and compared with the xor trick, in place of the fork's record behind a volatile field; and the elytra behavior's BlockStateInterface is the thread-safe copy, since the solver thread reads it for the lava case. The fork's invalidate() stays as the way the writer clears the field. Pushed so that CI's in-world test flies the four elytra stages with the PR's code, which the benchmark alone does not show. The chunk-cache workflow no longer triggers on this branch, so this push runs CI only. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WyYJgBP5vLVRjrcXVvTizn
Reverts the #5155 port so the branch head carries #5156's code once more, now that CI prints what the client log holds; the previous #5156 flight ran before that report existed. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WyYJgBP5vLVRjrcXVvTizn
|
Agreed, thanks for catching this, seems like volatile isn't needed: the record's fields are final, This is what my fork has flown since September, and I ported this exact PR onto it and ran the full in-game test twice (all stages, four elytra flights): passed both times, no exceptions from the mod (https://github.com/0Mattias/cheesecake/actions/runs/40257676667, https://github.com/0Mattias/cheesecake/actions/runs/40259193688). So it works. It's just not the fast option: replaying two fresh in-game flights through this For scale, The |
Making the
boicache thread safe the same way as thebsicache is not possible, because the shared empty/solid nether pathfinder chunks are reused for multiple positions. Unlike the change proposed by @0Mattias this does not use a volatile field.An alternative to this is to use separate caches for multiple threads, but that's more complicated and unless benchmarks show it's significantly faster I wouldn't go for it. See #5155 for that approach.
As a little drive-by fix this also makes the
bsiused byElytraBehaviorthread safe, which is required because the solver thread uses it. Idk why it doesn't usebaritone.bsi.There is also some optimization potential by making the solver claim the
bsicaches, but that needs a bit more work because unlike the regular pathfinder the pitch solver can run two times in parallel.Fixes #5136