Skip to content

run_gpu_tests: record cs_tbuffer_store's result; fail a run that records a test twice - #4784

Open
tunczzz wants to merge 1 commit into
ItsNotRexed:mainfrom
tunczzz:test-rgt-dup-result
Open

tunczzz wants to merge 1 commit into
ItsNotRexed:mainfrom
tunczzz:test-rgt-dup-result

Conversation

@tunczzz

@tunczzz tunczzz commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

scripts/run_gpu_tests.py on main runs cs_tbuffer_store but never records its result. The merge 3eb80d7 (in main since 66ff7cb, 2026-11-22) left that branch's results.append under the next branch, cs_fmt_d16_xyz, which then records two rows. A full run lists cs_fmt_d16_xyz twice and no cs_tbuffer_store. A cs_tbuffer_store failure therefore changes neither the report nor the exit code, even though docs/design.md names that fixture as the GPU check for tbuffer_store_format_*.

Two open PRs have the same slip (a new elif inserted between a check call and its results.append): #1529 drops cs_fmt_xy_xyz, and #2311 drops cs_fmt_sint32. Both are reported on the PRs. In all three cases the dropped test appears as a duplicate of the branch next to it.

Claimed on #4571 (comment).

  • run_suite: the line is back under cs_tbuffer_store. A new recorded_twice(results) check makes the run print an error and exit 1 when a test name is recorded more than once. I checked with an AST pass that no other path in run_suite appends twice; on main the only one was this bug.
  • tests/test_run_gpu_tests.py: OneResultPerTest runs each of the six one-function format rows (cs_fmt_1010102, cs_fmt_sint32, cs_fmt_int_narrow, cs_fmt_xy_xyz, cs_tbuffer_store, cs_fmt_d16_xyz) with its checker patched, the way PackedFormatFixture does. It checks that a failing check gives one FAIL row, "0/1 passed" and exit 1, and that a passing one gives "1/1 passed". RecordedTwice unit-tests the helper.
  • docs/testing.md: one sentence on the new error. docs/design.md: the tbuffer store row notes that its GPU check was not recorded from 66ff7cb until this fix.

Tested:

  • pytest tests/test_run_gpu_tests.py (WSL Ubuntu): 45 passed, 61 subtests. With main's runner, the new tests fail for cs_tbuffer_store and cs_fmt_d16_xyz. With only the line move reverted, the guard alone still makes a duplicated row exit 1 ("2/2 passed" plus the error).
  • Full pytest tests --ignore=tests/semantic -n 2 (WSL): 6990 passed, 157 skipped, 7 failed. Plain main 98fa503f has the same 7 failures: test_joaat_agreement (fixed by find_hash_lookup: hash --hash names as latin-1, like hashdict (test_joaat_agreement fails on main) #4753) and test_rdna2_decode llvm-mc parity (claimed by MichaelL401).
  • GPU: full scripts/run_gpu_tests.py on an NVIDIA GeForce RTX 5070 Ti (Blackwell, subgroup 32..32), driver 616.56, Windows 11 10.0.26300. Test programs were built from 98fa503f with MSVC 19.44; spirv-as/spirv-val and llvm-mc 21 came from WSL. Result: 170/217 passed, 47 skipped, 0 failed, exit 0. cs_tbuffer_store PASS (128/128 dumped words exact) and cs_fmt_d16_xyz PASS (80/80), one row each; no "more than one result" error.

No game files. AI-assisted (Claude Code).

🤖 Generated with Claude Code

…rds a test twice

The merge 3eb80d7 (in main since 66ff7cb) left the cs_tbuffer_store branch of run_suite without its
results.append: the line sat under cs_fmt_d16_xyz, which then recorded two rows. A full run listed
cs_fmt_d16_xyz twice and no cs_tbuffer_store, so a tbuffer_store failure changed neither the report nor
the exit code. Open PRs ItsNotRexed#1529 and ItsNotRexed#2311 repeat the slip for cs_fmt_xy_xyz and cs_fmt_sint32.

Move the line back, and make run_suite exit 1 with an error when a test name is recorded more than once:
each test records one row, and every case of this slip shows up as a duplicate. Unit tests run each
one-function format row with a failing and a passing checker and require exactly one row.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 29c1b038 on Windows 11 with an NVIDIA GeForce RTX 4090 and an AMD Radeon iGPU. The runner records one result for each fixture. Both adapters match all 128 expected words for cs_tbuffer_store and all 80 for cs_fmt_d16_xyz.

I also ran the two fixtures together on the RTX 4090 and changed the first expected store word from 0x3f800000 to 0x3f800001. The GPU still returns 0x3f800000. The PR reports the failed word, prints 1/2 passed, and exits 1. With the runner from parent 98fa503f, the same input prints two passes for cs_fmt_d16_xyz and exits 0.

I used the checked-in disassembly and the repository's Python SPIR-V assembler. The fixture checkers ran the real vk_compute_test.exe and read its dump. All 45 tests in python -I tests/test_run_gpu_tests.py pass. NVIDIA driver 32.0.16.2101. AMD driver 32.0.21043.5001.

AI-assisted.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this at 29c1b038e on Windows 11: pytest tests/test_run_gpu_tests.py -q -> 45 passed, 61 subtests passed; git diff --check clean.

The runner now records cs_tbuffer_store's result (it was checked but not appended) and fails a run that records the same test twice, with the added cases covering both; the docs note it. No blocking issue.

@DenRakEiw

Copy link
Copy Markdown

Tested 29c1b03 on Windows 11, Python 3.12.10 (CPU only, no game files): pass.

  • Trial-merged onto origin/main (98fa503): merges cleanly; git diff --check clean.
  • python -I tests/test_run_gpu_tests.py: 45/45 OK.
  • python -I tests/test_docs_links.py: 6/6 OK.
  • python -I tests/test_docs_design_rows.py: 4/4 OK.
  • Code read: moving cs_tbuffer_store's
    esults.append back into its branch and adding
    ecorded_twice(results) prevents duplicate-row regressions from hiding an earlier branch's result. No blocking issues.

AI-assisted review (Gemini).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants