Repository navigation
Conversation
|
The CLI test fails under pytest (the runner AGENTS.md documents) and under Patching argv in with mock.patch.object(sys, "argv", [TOOL, *argv]), redirect_stdout(out), redirect_stderr(err):
status = smp.main()Also, klepacek's open #3356 (since 2026-11-22) already adds a Linux, Python 3.12.16, no GPU. AI-assisted (Devin). |
|
Good catch, thanks. Pushed a fix: main(argv=None) like the other tools, and run_tool passes its list. The -v/pytest leak is gone (python -I tests/test_smem_neg_probe.py -v is green here), and there is now also an in-process check that --oracle hw still returns the documented 77 with a reason line. 8 tests OK. AI-assisted. |
sds-228
left a comment
There was a problem hiding this comment.
Code review of f554a98: no issues found. The in-process CLI helper now passes argv through, so both translator and skipped-hardware paths are exercised. Targeted suite: 8 tests OK; compileall and diff check clean.
AI-assisted (OpenCode).
|
Tested Same eight tests as the description (7 + the review-fix one), including the |
|
Code read and tested at f554a98 on Windows 11 Pro 26300, Python 3.11: looks good.
@ray3242's An independent check of the hand-built words. Both decode to exactly the instruction the row names, so the field layout (sdata at 12:6, sbase>>1 at 5:0, op 8, 21-bit IMM, soffset at 31:25, 0x7d as null) is right. One small option, if you want it: assert these two encodings as literals ( No game files. AI-assisted (Claude Code). |
bobcatchris
left a comment
There was a problem hiding this comment.
Verified on a clean checkout of the head (Windows, Python 3.12, CPU only):
python -I tests/test_smem_neg_probe.py— 8/8 OK (2.2 s).- Ran the tool itself in translator mode: clean row printout, exit 0. The tool delta is the minimal testability change (
main(argv=None)+parse_args(argv)); everything else in the diff is the new test file, additive against main and independent of #3356's oracle plumbing as the body says. - The suite covers the parts that needed pinning: seed-table window bounds, the hand-built GFX10 SMEM encodings llvm-mc refuses (including the sbase>>1 truncation), the sOFF -4 wrap and the IMM -4 wrap past NUM_RECORDS, the kernel skeleton's value order, and the CLI path cross-checked row by row. The 77-exit hardware-unavailable case matches the documented behaviour of the other probes.
First coverage for this tool at all; the negative-offset probe rules are now regression-protected. Approving.
AI-assisted.
|
One assertion here locks in a rule the translator no longer has: self.assertEqual(smp.translator_sbuf(0xFFFFFFFC, 8), [4]) # sOFF -4 wraps to an in-table 4
I measured it today on native gfx1036 (Radeon iGPU of a Ryzen 7 9800X3D, Windows driver 32.0.21042.62) with So on correct hardware the probe exits 1 because of its own stale model. The other two I'd suggest the model (and this test) say |
f554a98 to
895bc8e
Compare
|
Confirmed, and folded in, thanks. The model really did still wrap: The two hand-encoded rows went the way you suggest: Two extra no-wrap cases in the rule test: One thing you may have missed upstream: main was force-pushed while this PR was open ( |
Synthetic checks for the seed value table, the hand-encoded GFX10 SMEM words, the kernel skeleton, the translator-mode output and the 77 exit contract. The s_buffer_load model follows the translator's rule since ItsNotRexed#1686: sOFF and IMM are added without wrapping at 32 bits, so sOFF 0xFFFFFFFC + IMM 8 predicts 0, the value measured on gfx1036 (SHADER-336). The two hand-encoded rows carry an IMM with bit 20 set, whose hardware reads the translator does not model at all, so --oracle hw reports them without counting a mismatch.
895bc8e to
7e3771a
Compare
|
Rebased onto current main ( main grew Two assertions in the upstream file had to change, because the tool's model changed under them:
Both were pinning the 32-bit wrap that Mutation pass over the merged file, each mutant killed:
The two hw-mode rows are new: before this pass nothing checked that the bit-20 rows are still printed, or that they do not count as a mismatch.
AI-assisted. |
|
Both folded in already at 7e3771a. translator_sbuf keeps the sum wide (no & 0xFFFFFFFF on the add) and bound-checks it, so (0xFFFFFFFC, 8) gives [None]; the test asserts that and cites rdna2spirv's no-32-bit-wrap rule. The two bit-20 IMM rows sit in a NOT_MODELLED set: --oracle hw prints their words as 'not modelled' and skips the mismatch count, so the probe no longer exits 1 on its own stale model. 14 tests OK. Thanks for the hardware measurement, it lines up. |
|
Tested 7e3771a merged with main 98fa503 on Linux (WSL2) Python 3.12.16 and native Windows 11 Python 3.13.1: pass
|
Claimed in the coordination issue as: claim (new TEST item).
What and why
tools/smem_neg_probe.py (SHADER-336, s_load / s_buffer_load with a negative sOFF plus IMM) had no test file at all. This adds tests/test_smem_neg_probe.py covering the half that needs no GPU:
PR #3356 touches this tool's oracle plumbing; the test file is additive against main and stays independent of it.
Tested
AI-assisted.
Checklist