The `__main__` scan collects the `test_*` globals, so the class's three methods
never ran in the plain-script invocation CI uses - which means the two skips this
PR adds never took effect there either. The class is loaded explicitly now.
Measured here: the script run goes from 13 top-level tests to those plus
"Ran 3 tests ... OK (skipped=2)", and pytest still reports 14 passed, 2 skipped.
Written with an AI assistant.
They fail on Windows today, and CI cannot see it because that file runs on Linux
there: FeatureScanAtomicOutputTests' two "failed write" cases pass
preexec_fn=fail_file_writes to subprocess, which is POSIX-only.
Measured on main b8bd37111, Windows 11, Python 3.13: 2 failed, 14 passed before;
14 passed, 2 skipped after, with the reason printed. On POSIX nothing changes.
Written with an AI assistant.
- shader_disasm: prune stale listings against every input, not the --skip-existing remainder (a resumed run
deleted every listing it had just reused).
- progress_dashboard: a drive-letter path is never inside the repository off Windows (it printed user names);
its own read_text helper is read_utf8, so the encoding check does not take it for pathlib's.
- Translator tests follow this round's rules: desc_lookup's BroadcastFirst in the typed-load condition walker;
resinfo sizes are 0 past the last level and a 2D depth word is 0 (SHADER-388); SHADER-315 constant folding in
the perm and i16 tests; #2089's structured wave64 emulation.
- test_semantic_translator_use: 57 oracle-only files merged before it are DEBT; test_spirv_tools_required is
allowed (CI meta-test).
- Test fixes: image_fuzz fake writes the programs, preflight follows c506d00c's loader hint rule, feature_scan
reads the first line of a pytest-decorated message, w64_graphics wording.
- docs: rows merged again in design.md, README.md, d3d12_vulkan.md; GameInput table rebuilt from #3172's rows;
orphan rows in models.md and embedded_shaders.md; repeated bullets; anchors; a flag not on main.
- Repo rules: stdout guard on 14 programs; LF writes; csv lineterminator in bink_play.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_duplicate_shader_names_keep_file_stages() is the only test in the
file whose assertion is a bare assert; in the file's stdlib run mode the
__main__ runner's except-AssertionError-pass swallows it, so a regression
prints OK (0 failures) and exits 0. Route it through check() so it
counts into the failure tally, prints, and fails the exit code.
Every test ends in `assert failures == 0` over the module-wide count, so after one failed check run_tests
reported every later test as failed too. Each test now starts from its own count; the counts are added back
to the run's total. New test pins it.
CI's standard-library job runs tests/test_feature_scan.py with python -I. Its
__main__ held all eight tests in one try block that swallowed AssertionError,
so a failing bare assert (test_duplicate_shader_names_keep_file_stages ends in
one) skipped every test after it and the run printed "OK (0 failures)", exit 0.
Each test_* function now runs on its own (run_tests), taken from the module in
file order so a new test is not left out; one that raises is reported and
fails the run, and the rest still run. A new test covers run_tests.
AI-assisted.
A literal V# word 3 with FORMAT 0 (an unbound descriptor) reads 0 on the
hardware and in the translator, so it is not listed as a format the
translator lacks. Row 16 gets the counts over the 1.0.2.1 corpus.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PSV0 resource bindings give the structured UAVs with a counter and the
typed buffer SRVs/UAVs; the listings give the MTBUF instruction formats
and, for MUBUF *_format ops, where V# word 3 comes from in the access's
basic block (literal, scalar load, computed, an earlier block or a
shader input). Formats are checked against rdna2spirv.Gen.FORMATS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`feature_scan.py <shaders> --out <shaders>/dxbc/index.json` wrote the report
over the corpus index and printed the counts with exit 0, so the next run of
the same command failed with "is not a shader list" and the shaders stage of
make_game.py had to be run again. A scanned .dxbc, a listing in dxbc/disasm
and the spirv/index.json the scan reads had the same problem.
--out is now checked against those inputs before anything is read: one line
and exit 2 naming the path, and nothing is written. Report paths outside the
shader folders are unchanged, including the missing-folder creation.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
main() built stage_of from the file stems, then overwrote it with the
original shader names. Two variants with the same original name but
different stages (same.dxbc as gs, same~1.dxbc as ms) both took the last
one's stage, so the disassembly counts gave {'ms': 2}. File stems now win;
original names are only a fallback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both tools opened --out with a bare open(..., "w"), so a path whose parent does
not exist threw FileNotFoundError after the whole scan or the whole compile run
had already finished (#934 is the same defect in hashdict.py). awc_manifest.py
and the other tools create the parent first; these two now do the same.
Tests: the existing CLI fixtures run each tool with --out inside a nested folder
that does not exist, and assert a clean exit and the file landing there. Both
fail without the change: feature_scan reports "FAIL --out creates a missing
folder", turing_atlas raises the FileNotFoundError the fix removes.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
main() opened <shaders>/dxbc/index.json straight away, so a mistyped
path, a file, a work folder whose shaders stage hasn't run, a broken
index.json and one that isn't a list all ended in tracebacks
(FileNotFoundError, NotADirectoryError, JSONDecodeError,
AttributeError). Each now prints one line naming the path, and what to
run when the index is missing, and exits 2 before --out is written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
streams() read `count` 32-byte elements at `first` without checking the part
length, so a truncated OSG1 raised struct.error out of scan_dxbc and killed the
whole count-only scan. Treat a signature whose element table does not fit (or
whose first element overlaps the 8-byte count/offset header) as carrying no
stream information, matching the existing len(sig) < 8 case. Well-formed
signatures are read exactly as before.
Synthetic regression test in tests/test_feature_scan.py: it fails on
unmodified main with struct.error and passes with the fix; a work folder with
one truncated OSG1 still prints the summary and keeps the real stream-1 count.
No game data, no GPU. Full CPU suite: 1559 passed, 150 skipped, 1 xfailed;
semantic suite: 423 passed; compileall and --help clean.
New BUILD item claimed in #374. AI-assisted (OpenCode).
Counts, from what the shaders stage leaves in <work>/shaders, the features docs/d3d12_vulkan.md
§8.2 #10 and #14 ask about: the DXIL program kind of every shader (hull, domain, amplification),
the SFI0 D3D_SHADER_REQUIRES_* flags (values from the Windows SDK's d3d12shader.h, among them
WAVE_MMA and SHADING_RATE), output-signature streams other than 0, native v_mfma/v_wmma and
GDS/ordered-count instructions in the disassembly, and uses_code_base per stage from
spirv/index.json. Prints counts only. tests/test_feature_scan.py checks it on a synthetic work
folder (hand-built DXBC parts, listings and index).
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>