Repository navigation
Match native paradrop heading and coordinate rounding - #1028
Merged
Merged
Conversation
Keep the full FacingClass word and round after adding the original radius
displacement to world coordinates. Reuse native_trig and ground_pose owners
instead of byte-facing offsets and duplicated Location conversion.
Native evidence: DropPayload 0x00415C7D..0x00415D78, saved in
tools/spatial_oracle/paradrop_coordinates.{py,json,meta.json,md}.
All 393216 tested coordinate prefixes match. Coverage ends before native
Map admission and does not certify the complete paradrop mission.
The focused production regression failed before the fix. Final validation:
9565 lib tests passed, 227 ignored, clippy completed with existing warnings,
field ratchet unchanged, and one fresh read-only critic found no blockers.
Partially addresses #816; separate Rocket estimate concern is #1027.
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.
What changed
Paradrops could select the neighbouring landing cell because the code reduced the aircraft heading to a byte and rounded an approximate offset before adding it to the world position. At full heading
0x007F, with an even post-decrement payload count at cell(50,20)'s centre, native chooses(50,20)while the former path chose(51,20). This changes occupancy admission and retry outcomes.Use the full FacingClass word, the original wrapping
+/-0x3FFFturn and the existing native trig owner to truncate the final world coordinate. Reuseground_posefor Location reads/splits, including signed remainders. Remove the supersededv_offsetandsim_to_i32paths and correct the shared math documentation's precision/range/determinism claims. SimFixed's representation is unchanged; no simulation fields or serialized layout are added.Linked issue
Addresses the paradrop reader in #816: the original uses the full word, rather than either rounded or truncated byte conversion. The other readers in that issue remain open. The separate Rocket distance-estimate finding is recorded in #1027; its native behavior is unverified and is not changed here.
Evidence
0x00415C7D..0x00415D78, body FacingClass Current, retail sine/cosine and ftol; original radius128, no INI input to this numeric prefix.Reproduce with
python -m tools.spatial_oracle.paradrop_coordinates --checkandsim::aircraft::drop_payload::tests::paradrop_world_coordinates_match_all_native_headings. Fixture contract and limits and the JSON provenance retain the original binary identity and coverage. The native corpus stops before map lookup/admission; downstream Rust regressions do not certify a complete native paradrop mission or whole-game determinism. RNG, timer and detach boundaries are recorded in the evidence note.Tests run
cargo test -p vera20k --lib: 9,565 passed, 227 ignored, 0 failed.cargo clippy -p vera20k --lib: exit 0 (727 warnings; none in the new drop implementation).rustfmt --edition 2024on edited leaf files;git diff --check.cargo run --release --bin vera20k: not run; this coordinate change is checked through the production simulator tests, including the existing complete descent/carrier-despawn test.Both Rust commands use
tools.cargo_runwithVERA20K_REQUIRE_RETAIL_INI=1and local retail INIs. The 10 focused drop tests pass. Native regeneration followed by a read-only check passes. The field ratchet remains 2,532 versus 2,532; Python generator help/compilation and evidence links pass.AI assistance
Independent read-only critic: no blocking findings. The critic checked the original instructions, fixture identity, source hashes and production handoff, and independently replayed 24 native samples in fresh emulator instances through the actual Map-call argument; all matched the corpus. No visible runtime capture was reviewed.
Checklist