Repository navigation
Stage 6.4b: probes, probe batches, baked reflection data and lookups - #40
Merged
Merged
Conversation
Ports probe, probe_generator, probe_tree (moved from stage 7: ProbeBatch::commit builds one), probe_batch, probe_data, probe_manager, baked_reflection_data and baked_reflection_simulator, with the FlatBuffers schemas probe_batch.fbs and baked_reflection_data.fbs. - probes: Probe, ProbeTree, generate_probes (centroid, uniform floor), ProbeBatch (serialize/deserialize), ProbeNeighborhood (entries refer to batches by index in the batch list), ProbeManager (Arc<ProbeBatch>). - baking: BakedDataIdentifier (ordered like upstream's operator<), BakedData enum, BakedReflectionsData. - simulation::baked_reflection: find_unique_probe_batches, lookup_energy_field, lookup_reverb. - serialization: int8 and struct fields, vectors of offsets with upstream's null offsets. Bit-exact on Windows (debug and release) against tools/golden/src/probes.cpp: probe trees and queries, generated probes, neighbourhoods (occlusion, weights, nearest), lookups, and serialized batches byte for byte across six rounds of changes. Upstream quirks kept: R27. A probe index past another batch's data, which upstream reads out of bounds (it crashed the first generator draft), is skipped. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Stage 6.4b of
docs/PORTING_PLAN.md: probes, probe generation, probe tree, probe batches, neighbourhoods and manager, baked reflection data and its lookups, with probe batch serialization.What's ported
probe,probe_generatorprobes::Probe,probes::generate_probes(ProbeGeneration::Centroid,UniformFloor { spacing, height })probe_tree(moved from stage 7:ProbeBatch::commitneeds it)probes::ProbeTree,ProbeTreeNodeprobe_batch,probe_batch.fbsprobes::ProbeBatch(serialize/deserialize),ProbeNeighborhoodprobe_managerprobes::ProbeManager(Arc<ProbeBatch>)probe_data,baked_reflection_data,baked_reflection_data.fbsbaking::{BakedDataIdentifier, BakedData, BakedReflectionsData}baked_reflection_simulatorsimulation::baked_reflection::{find_unique_probe_batches, lookup_energy_field, lookup_reverb}Neighbourhood entries refer to batches by their index in the batch list instead of by pointer. The lookups take that list and the unique batches, so callers (and the tests) choose the order in which batches are summed. Upstream's order comes from an
unordered_setof pointers, so it depends on addresses.Parity
Every case below is bit-exact on Windows, in debug and in release, against
tools/golden/src/probes.cpp. The test usesEXACTfor indices and bytes andF32for float results:boxroomaxis-aligned,simplescenerotated)[B0, B1, B0]queried at 48 points inboxroom: influencing probes, occlusion, weights, nearest probe, unique batches, and energy-field and reverb lookups for 3 identifiersNo libm is involved, so other platforms should match too. Truncated and corrupted batches return errors and never panic.
Upstream quirks (R27) and deviations
ReferTo(0). The port writes the same bytes and reads them back as "no field".MalformedSerializedDatauntil stage 7.DEVIATIONS.md.Checks:
cargo fmt --check, bothclippyconfigurations andcargo test --allpass locally.