Skip to content

Match native paradrop heading and coordinate rounding - #1028

Merged
hrusten merged 1 commit into
mainfrom
feature/simfixed-conversion-boundaries
Oct 3, 2026
Merged

hrusten merged 1 commit into
mainfrom
feature/simfixed-conversion-boundaries

Conversation

@hrusten

@hrusten hrusten commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

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 +/-0x3FFF turn and the existing native trig owner to truncate the final world coordinate. Reuse ground_pose for Location reads/splits, including signed remainders. Remove the superseded v_offset and sim_to_i32 paths 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

  • No gameplay change
  • Native behavior established: original DropPayload 0x00415C7D..0x00415D78, body FacingClass Current, retail sine/cosine and ftol; original radius128, no INI input to this numeric prefix.
  • Rust regression tested: the focused landing-cell regression failed before the fix; production drop tests cover selected native landing cells, opposite occupancy outcomes, cargo retry, Reveal and canopy lifecycle.
  • Parity demonstrated: all 65,536 headings, both payload sides and three supplied coordinate origins (393,216 native coordinate prefixes), compared against saved output digests and samples.

Reproduce with python -m tools.spatial_oracle.paradrop_coordinates --check and sim::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 2024 on edited leaf files; git diff --check.
  • Played it with 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_run with VERA20K_REQUIRE_RETAIL_INI=1 and 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

  • No AI tools were used
  • AI tools helped: Codex performed the native investigation, implementation and validation; a separate read-only audit checked adjacent numeric helpers.
  • I can explain every change in this PR.

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

  • No game executable, retail asset or INI files added; fixtures contain bounded native execution results.
  • README status considered: this corrects an existing paradrop calculation and makes no new whole-feature completion claim.

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.
@hrusten
hrusten merged commit 5e8609b into main Oct 3, 2026
7 checks passed
@hrusten
hrusten deleted the feature/simfixed-conversion-boundaries branch October 3, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant