startup: reassemble the NGG slice cases with llvm-mc in a binary mode #1993
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2000"
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 R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-24T22:54:02Z.
Change
Follow-up to #1961, which merged before this commit was pushed:
tests/startup_ngg_slice_check.pygains an optionalbinary <llvm-mc>mode. It converts the fixture's six NGG programs to LLVM assembly text, assembles them with LLVM 15llvm-mc(gfx1013, wave64) and requires word-for-word identity with the fixture's own encoder. A deliberately wrong encoder word must be reported as a mismatch.The mode is added to the Linux LLVM job, next to the sibling
binarychecks. The pure-Python mode is unchanged. The docs section now gives the command instead of saying the words are not reassembled.Test only. Refs #1723. AI-assisted (Claude Code).
Verification
On this branch (one commit on
main), with LLVM 15.0.7:python -B tests/startup_ngg_slice_check.pyprints6 cases decoded, anchored and separated under 3 interpretations; 6 planted model faults detected.python -B tests/startup_ngg_slice_check.py binary <llvm-mc>prints that line and342 instructions of 6 programs match llvm-mc; a wrong encoder word is reported.python -B tests/docs_links_check.pypasses.Not run locally: the Linux job itself (it uses
llvm-mc-15from the Ubuntu package, as the sibling checks do).Evidence and follow-up
rdna2_tools_check: the VOP3v_mbcnt_*andv_lshl_or_b32forms, the VOPCv_cmpx/v_cmpforms,exp primandexp param0,s_sendmsg sendmsg(MSG_GS_ALLOC_REQ),s_barrier, andds_write_b32/ds_read_b32with offsets.primexport target,vccin wave64, branch labels); the mode converts those before assembling.startup_smem_address_check.py binary.Checklist
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T23:01:14Z.
What I could run here, and what I could not
Windows 11 build 26300.9974, no LLVM on this machine — so the reassembly itself is unverified by me and I am not claiming otherwise.
Two things that check out from that:
llvm-mcthe new mode refuses with the usage text instead of silently passing, which is the failure mode that mattersfor a
binarysubcommand.The negative control is sound, and I checked why
program()builds a fresh list on every call (no memoisation), so mutatingwrong[1][1]after the per-case loop cannot corrupt thefixture — I looked, because a cached list here would have made the control flaky rather than wrong.
!= 1rather than> 0also pins thatllvm_words()returns only the mismatching entries — a version that returned everything wouldfail this control.
One gap in that control
It proves the comparison notices a wrong word. It does not prove the text side is exercised at all: if
llvm_text()produced a linellvm-mccannot parse,subprocess.run(..., check=True)raisesCalledProcessError, and the run ends with a traceback rather than thefixture's own message. Two small changes would close both:
The first is the one I would insist on: the whole point of the mode is to compare the fixture's encoder against LLVM, and today a bad
translation of the text fails in a way that looks like an infrastructure error.
What the mode does not establish
gfx1013+wave64via-mattr=+wavefrontsize64,-wavefrontsize32is the right invocation for these six programs, but the mode is areassembly check: it says the encoder and LLVM agree on the bytes, not that the bytes mean what
ANCHORSclaims. The pure-Python modeand the
rdna2_tools_checkgolden vectors carry that half, and both are unchanged here.Notes
binarymode was not executed; everything under "verified" above is the pure-Python mode and the no-LLVM refusal.