tests: cover shader_compute_request parsing, keys, and validation #3736
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3736
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3734"
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?
@Ammmae0x on GitHub · 2026-12-01 13:02 UTC · original
Ammmae0x:tests/shader-compute-request→main· +1456 −0 · 5 files · 2 commits · merged 2026-12-02 05:17 UTCRefs #1149
Portable C++17 unit, refusal, and mutation tests for
src/shader_compute_request.cpp, with zero edits to existing files (5 new files only, +1402/-0).What is covered (10 cases in
tests/shader_compute_request_check.cpp, linking only the check plussrc/shader_compute_request.cpp):fnv_and_keys: FNV-1a values and the pinned graphics (x2w-startup-shader-29/ rev-28 fallback), compute (x2w-startup-shader-29cs/ rev-28cs, length-prefixed parts) and mesh (x2w-startup-mesh-57-4) keys; the graphics key is ambiguous across a part boundary while the compute key is not.pixel_input_format_parse: format/parse round-trip, either field order, the 13-byte binary entry, and all exact errors.rtv_variant: 1..8 formats, the0xffffffffboundary, FNV-1a key match, and the exactinvalid RTV variant request/invalid RTV variant valueserrors.read_pixel_input,read_graphics,read_graphics_rtv,read_compute: syntheticreq_<key>files, revision fallbacks, RTV variants resolving their base request, and the exact refusal strings.validate_compute_shape,compute_wave32,read_container: the 28-byte state block A, the wave32 bit (byte 18,0x10), and thenative-container-1container key with the 32-byte floor.Mutation controls (
tests/cmake/shader_compute_request.cmake, 5WILL_FAIL TRUE): graphics revision, pixel-input contradiction, compute.desccode-size offset, wave32 bit, RTV format ceiling. The mutated file is the.cppitself, so each control links the mutated copy directly. A CMake fragment smoke test in a scratch layout confirmed the fragment parses and all 5 mutant copies differ from the source.Linux verification (this host, g++ 13.3.0):
tests/shader_compute_request_meta_check.py:PASS: shader compute request: 10 cases, 5/5 mutations killed (g++)(real test run all-at-once and per case, every mutation compiled against a real C++ copy, 1:1 with the CMake set, zero model-only mutants; temp dirs removed infinally).tests/form_coverage_check.py,tests/docs_links_check.py(208 files / 802 links),tests/bidi_controls_check.py(2826 files): pass.git diff --check: clean.Notes:
-Wno-error=missing-field-initializersonly: the unmodified source triggers-Wmissing-field-initializersat theGraphicsRequestaggregate initialiser inread_graphics_request(thertv_request/rtv_formatsmembers have no explicit initialiser). Every other warning stays an error and the source is unchanged.readhelper's"truncated compute request"guard is unreachable through the public entry points because both extent checks testdesc.size() != 96first and short-circuit; the suite pins the observable behaviour (a short.descis refused as"inconsistent compute request") and documents this indocs/experiments/shader-compute-request.md.Windows Verification (
b5c13ad0)git merge-tree --write-tree upstream/main HEAD->971021e0(exit 0),git diff --checkcleanpy_compile,form_coverage_check.py,docs_links_check.py(209 files, 806 links),bidi_controls_check.py(2829 files) passeddev16/16 x 5 repetitions passed (1.19s);release16/16 x 5 repetitions passed (1.12s);shader_compute_request_check:PASS: shader_compute_request: 10/10 cases passed. AI-assisted.@Leyukaka on GitHub · 2026-12-01 14:18 UTC · original · reviewed
Please give each TempDir instance a unique directory. It currently uses a fixed path per case and calls remove_all on that path at setup and teardown. A parallel CTest run can execute shader_compute_request_read_compute, shader_compute_request_all, and the compute extent mutant simultaneously. They all use the same read_compute directory, so one test can remove another test's fixtures.
An atomically created per-instance directory would keep these runs independent. Running the suite with CTest parallelism would verify the fix.
@Ammmae0x on GitHub · 2026-12-01 14:32 UTC · original
@Leyukaka Addressed in
b5c13ad0:TempDirintests/shader_compute_request_check.cppnow creates a unique per-instance path atomically withfs::create_directory(process ID +steady_clocktick + atomic counter, retrying on collision), with setup never removing anything and~TempDir()removing only its own directory.Verified under parallel CTest stress on Windows (
16/16tests x5repetitions at-j16):AI-assisted.
@R0Y00 on GitHub · 2026-12-02 05:16 UTC · original · approved these changes
Confirmed the earlier temporary-directory concern is addressed at
b5c13ad0.TempDirnow claims paths atomically and cleans up only its own path. I built the base test and all five mutant executables with MSVC Debug, then ranctest --preset dev --no-tests=error -j16 -R '^shader_compute_request' --repeat until-fail:5 --output-on-failure. All 16 tests passed five times, including all five mutation controls.