Repository navigation
mem_diff: give tbuffer programs a bound V# (the instruction's FORMAT), as 2dfd8d47 requires - #1491
etcetera-yt wants to merge 1 commit into
Conversation
…, as 2dfd8d4 requires 2dfd8d4 (measured on gfx1036) made a V# with FORMAT=INVALID read zeros even for tbuffer_load_format, which takes its format from the instruction. mem_diff's buffer_format family built every tbuffer V# with only the identity swizzle in word3 (FORMAT 0), so all of them now read as unbound while its reference still decoded them: test_mem_diff.py failed on main with 32 mismatches. Put the instruction's format in the V# too, as a descriptor bound to that data would have; the reference keeps decoding from the instruction's format, and no RNG draw is added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@etcetera-yt, I applied the #1396 differential reference tests to an archive of your head 63a054f, leaving your generator and model unchanged. The 60-case CI seed passed. Two hand-made controls still failed: the reference returned 0x3f2aaaab where an INVALID descriptor returned 0 on hardware, and a bound 32_UINT MTBUF xyzw with zero V# selectors returned [0,0,0,0] instead of [42,0,0,0]. Both pass on #1396 at 95da3ff. The remaining two-file fix in #1396 covers both the generator and these reference cases. Its bound descriptor deliberately has a different format from the instruction, so confusing those sources is observable. Your docs pointer is helpful; I will update that same paragraph on #1396 with the native channel-order result. AI-assisted. |
|
Thanks @Vonsek, that's a clear check. You're right: my change only fixed the generator, so the reference still decodes an INVALID descriptor and still misses the zero-selector case, both of which your controls catch. #1396 fixes both sides, and its bound descriptor deliberately differs from the instruction's format, which is the better test. I'm closing this in favour of #1396. AI-assisted (Claude Code). |
Claimed in the coordination issue as: new TEST item (claim). No ID assigned yet.
What and why
tests/test_mem_diff.py(CI's stdlibcheckjob runs it directly) fails on mainbb2e184:The first bad commit is 2dfd8d4 (@Vonsek, "suppress MTBUF loads from unbound descriptors", in #1396):
c2967a5OK,2dfd8d47FAILED,bb2e184FAILED. That change is right and measured: on gfx1036, a V# with FORMAT=INVALID reads zeros even fortbuffer_load_format, which takes its format from the instruction.The stale side is
tools/mem_diff.py's generator. Itsbuffer_formatfamily built everytbufferV# with only the identity swizzle in word3 (FORMAT 0), so since 2dfd8d4 everytbufferprogram reads as unbound (zeros), while the reference still decodes it.tools/mem_diff.py(gen_buffer_format): atbufferprogram's V# word3 now also carries the instruction's format code, as a descriptor bound to that data would have. The reference still decodes from the instruction's format (unchanged), and no RNG draw is added, so seeds pick the same programs.mem_diff.pydocstring anddocs/shader_validation.md(thebuffer_formatparagraph) say why thetbufferV# carries a format.What's left: nothing for this failure. Separate, pre-existing (not from 2dfd8d4, not fixed here): with other seeds, a few
tbufferprograms that read a channel the format lacks (e.g.tbuffer_load_format_xyzwon16_16_SNORM, word 2) still differ: the reference repeats the channel (c mod n), the translator gives 0.--seed 7 --programs 300shows 3 such mismatches onc2967a5, onbb2e184with this change, and among the 27 onbb2e184without it. The doc already liststbuffer's DST_SEL handling as unmeasured. I'll post it as a finding.Tested
Windows 10 19045, Python 3.14.7 (CPU only; no
llvm-mcneeded, the fuzzer uses the translator and the semantic interpreter). The machine's GPU is an NVIDIA GeForce RTX 5060 Ti, driver 621.14.c2967a5bb2e184tests/test_mem_diff.pybuffer_format)mem_diff.py --programs 300 --seed 7mem_diff.py --self-testtools/mem_diff.pyput back,test_mem_diff.pyfails again with the same32 != 0.tests/test_mem_diff.pyon worktrees of2dfd8d47^(=c2967a5),2dfd8d47andbb2e184.Not tested: a GPU run of the generated
tbufferprograms (that needsllvm-mc, not installed here).Checklist
docs/design.md, with how it was confirmed. (Not applicable: no translator change.)AI-assisted (Claude Code).
🤖 Generated with Claude Code