fix: the Rust RDNA 2 interpreter refuses an indexed register past 32 bits #402
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/402"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LooperSalty/AnyXboxX. Originally posted by Luke-Ervin on 2026-11-26T17:26:48Z.
Change
The Rust reference interpreter (
crates/anyxboxx-rdna2-ref/src/movrel.rs) now refuses a movrel register index that passes 2^32, as the Python model does. Before, it added the register number and M0 asu32:attempt to add with overflow) instead of returning the interpreter's error.emu/rdna2_exec_movrel.py): unbounded integers, index0x10000002C, refused as outside the model (Untranslated), which is what its docstring specifies.check()now takes the register and the offset separately and adds them inu64before applying the same range and even-pair rules. Nothing changes for sums below 2^32.Affected forms:
s_movrels_b32/b64,s_movreld_b32/b64,v_movrels_b32,v_movreld_b32,v_movrelsd_b32. Not affected: the_2forms andv_swaprel_b32(10-bit fields of M0, cannot overflow) andv_swap_b32(no offset).docs/rust-full-status.mdanddocs/fr/rust-full-status.mdrecord the finding. No README row or test-count change (1902 collected, still1900+).Linked issue: none.
Verification
Run on Linux (Ubuntu, Python 3.13, Rust 1.98.1), on top of
mainat47759e8, withanyxboxx-rdna2-refandanyxboxx-pebuilt bycargo build --release -p anyxboxx-rdna2-ref -p anyxboxx-pe:Reproduction before the fix (input to
anyxboxx-rdna2-ref):lanes 32,scc 0,primitive 0,s 124 FFFFFFFD,s 44 12345678,program BEE62E2F BF810000. Release printeds 102 12345678; debug panicked atmovrel.rs:134. Both now printerror untranslated.Not run (the 449 skipped tests): everything that needs Windows, the C++ runtime,
dxcor a GPU, and the Rust crates that only build for Windows;cargo test --workspacefor the same reason. No Windows machine was available. The change is plain integer arithmetic. No game was run.Oracle and test data
tests/test_rdna2_ref_parity.py.test_indexed_registers_past_32_bits_are_refused_by_both_models(seven forms × M0 =0xFFFFFFFD,0xFFFFFFFF,0x80000000, plus M0 = 1 as the in-range control) fails on the old release binary. The Rust unit testan_index_past_32_bits_is_refused_not_wrappedpins the refusal.Checklist
E_NOTIMPL), never a fake success.test_readme_sync.pychecks it). No README change needed.This change was made with AI assistance (Claude Code): the bug was found, fixed and tested by the AI as described above. It was not tested on Windows.
🤖 Generated with Claude Code
Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T17:26:58Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
1fe066aℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from LooperSalty/AnyXboxX. Originally posted by akimfomin on 2026-11-26T23:21:03Z.
The movrel overflow regression catches the old arithmetic in an optimized Windows build. On
b676bbc429aa3c98ab36b7d3b4907a6dd1935618all three movrel tests passed in debug and release. In an isolated copy of the exact reference crate, I then restored wrapping only incheck; the regression failed because the unsupported index returned success. Pinned source and regression. This crate-only run excludes launcher and audio.The PR also merges cleanly against the actual post-#454
b6d86cf. A useful final guard is to keep the overflow case in the release-mode reference test job, where the original wrong success is observable. PortBridge · AI-assisted test report.