shader: pin the GFX10 opcode-name resolution with unit tests (#477) #502
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!502
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-498"
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?
@AnastasisKon on GitHub · 2026-11-27 22:18 UTC · original
AnastasisKon:vibe/opcode-name-tests-1705ac→main· +91 −0 · 1 files · 1 commits · merged 2026-11-28 01:36 UTCWhat this changes
Refs #481. Test-only, in
crates/victory-shader/src/gfx10/mod.rs.name(encoding, opcode)was untested, so a table edit could silently rename an instruction; the survey's unnamed-opcode counts and refusal messages read the same names. Pinned now:u16::MAX) resolves to no name, not a neighbour's;"exp"whatever its opcode field holds;0x140=v_fma_legacy_f32(#321) — with the invariant that no VOP3-table entry sits in a shadowed base range.Synthetic opcodes only; no game data, no behaviour change, no new dependencies.
How it was tested
cargo test -p victory-shader— 406 passed (incl. the 4 newgfx10::tests), 0 failedcargo test -p victory-hle -p victory -p victory-gpu -p xtask— pass (RC=0)cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings— pass (RC=0, 0 errors)cargo xtask policy— pass (398 files ok)Checklist
VICTORY_*variable — n/a, none added@AnastasisKon on GitHub · 2026-11-27 22:19 UTC · original
Two pull requests pin #481 — this one and #484 (
vibe/opcode-name-tests-4f9c68, opened 19 minutes earlier). Both are test-only and green. I have closed #484 and kept this one, because it pins more:every_table_entry_resolves_to_its_own_namewalks the tables rather than sampling them, andtables_are_sorted_so_the_binary_search_finds_thempins the invariantname()'s binary search actually depends on, which #484 did not cover at all.Two things worth fixing here before it lands:
flat_offsets_ignore_bit_elevenis a second subject — FLAT offsets are not opcode names — and CONTRIBUTING asks for one change per pull request. It is a good test; it would be a fine PR of its own, or could join afieldssuite (gfx10/fields.rshas no tests at all, and offset decoding is where that test belongs).ir_tests.rs,range_tests.rs,gfx_refusal_tests.rs,emit/lockstep_tests.rs— rather than inline, sogfx10/opcodes_tests.rswould match the neighbourhood. Style only; the module is declared undercfg(test), so either way the build hash is unchanged.For reference, the coverage #484 had that is now only here: one name per encoding table (19 encodings, EXP ignoring its opcode field), the VOP3 bases for VOPC/VOP2/VOP1 with
0x140asv_fma_legacy_f32, and past-the-end opcodes resolving toNone. All three are covered by this PR's tests, which is why closing #484 loses nothing.@Olima34 on GitHub · 2026-11-28 01:36 UTC · original · approved these changes
Check report (helping the maintainer clear the queue):
checkandmacos-scriptsgreen on the current head.#[cfg(test)]module). Every GFX10 opcode table is sorted and resolves to its own names. No translator code changes.226645f9) merged with this PR and the other test/docs/tools PRs we're landing in this batch (#401 #403 #426 #471 #475 #479 #483 #485 #490 #493 #498 #502 #509 #515). On it, thevictory-gpu(arm64),victory-shader,victory-backend,victory-metalandvictorytests pass, as do the macOS script tests (rustup-path.sh,run-summary-compare.sh,run-summary.sh --self-test), Windows clippy (-D warnings) andcargo xtask policy. Onevictory-gpurun in four failed main's ownmulti_mip_array_and_placed_depth_twins_preserve_all_subresources_and_remirror_immediately. That test also flakes on main alone, so it isn't from this batch.Thanks @AnastasisKon!