Repository navigation
SHADER-638: prototype full 64 KiB LDS for emulated Wave64 compute - #3422
kacper-serewis wants to merge 7 commits into
Conversation
|
Independent CPU re-review confirms ds_nop fixed at 67d55f8: all nine modules pass Vulkan 1.2 spirv-val. Nop, swizzle, bpermute and permute retain a 564 B exchange with no guest LDS; real reachable writes use the 65,536 B loan. A write after s_endpgm in the same block is ignored. Remaining structural limitation: a separately labelled block skipped by an unconditional branch still participates in loan eligibility/code generation; its dead write can force 65,536 B rather than 564 B. This predates the no-op correction. Keep draft pending that scope decision and capable-device execution. Local RTX 5070 reports only 49,152 B. AI-assisted, synthetic CPU review only. |
|
Tested
Test programs built with MSVC (VS 2026) via CMake; AI-assisted (Claude Code). |
|
Verified on Linux: merges cleanly into current main. The new SHADER-638 suite passes (6 tests), shared_memory_limit 15, w64x_scalar_load_order 5, wave64_emulate_opt 22, and tests/test_translate.py 581 passed / 4 skipped under pytest. The rule arrives the right way: design.md contract row, hand-written .asm fixture, and the real translator driven through the shared helpers. Note: test_loop_ballot_barrier shows 3 failures + 2 errors on the merged tree, but the byte-identical set fails on plain main too (re-confirmed today) — pre-existing, not introduced here. The rsrc2 LDS_SIZE fix in that helper is genuine (field is [23:15], the baked 0x8090 set size+1). #4152 touches the same file; sequence accordingly. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
…eachable LDS writes
kacper-serewis
left a comment
There was a problem hiding this comment.
SHADER-638, AI-assisted integration 89eb783. Depends on: #1882 (merged). The synthetic full-LDS, shared-limit, native barrier-count, emulation optimization and scalar-order suites passed 57 tests. The loop/barrier suite produced the same three failed subtests and two interpreter errors on main and this commit. Eight synthetic modules passed Vulkan 1.2 validation. On Windows RTX 5070, driver 616.56, subgroup 32, three supported or privately scaled probes each had 0/64 readback mismatches. The device exposes 49,152 bytes of shared memory. The production 65,536-byte module passed static validation only. Full-size dispatch, performance and spilling remain unmeasured; keep this PR draft.
|
Independent ASSET-278 CPU review at 89eb783: pass. A new local-only 1,024-invocation oracle filled all 16,384 guest-LDS dwords with stripe/lane-distinct sentinels, forced two consecutive borrowed ds_bpermute exchange rounds, then read every dword through the emitted module. Forward scheduling: 16,384/16,384 matched; reverse subgroup scheduling: 16,384/16,384 matched. As a negative control I changed the unique restore destination from %xb_p0 to %xb_p1024; the same oracle detected exactly 1,024 corrupt dwords, all in stripe 0, so the check distinguishes a one-stripe restore/index fault. I did not repeat the existing 57-test integration run. Limitation: this CPU interpreter checks rendezvous and deterministic save/restore correctness, not GPU memory-model behavior, performance, or spilling; a capable >=64-KiB device is still needed. Documentation note: the final PR-body sentence about an unreachable labelled DS write selecting the loan is stale at this head—89eb7839 and test_branch_skips_only_guest_write now exclude it. Synthetic data only; AI-assisted. |
|
Independent CPU correctness review of What was checked
No game files, no GPU run (CPU interpreter only). AI-assisted. |
|
Independent CPU review of the save/exchange/capture/restore scheduler at How it was checked This is a different kind of check from the code audit and test-suite run in the comment above: I did not reuse the PR's tests. A generator writes random kernels from 16 building blocks: LDS writes and reads at lane addresses (inside the borrowed window, right behind it, mid-array and in the top stripe), reads of another lane's word,
Does the harness see a wrong scheduler? I broke
The last barrier is only caught by kernels in which a lane reads another lane's word, which is why those reads are in the generator. Reading the change
Notes, none blocking
Windows 11, Python 3.12.10, SPIRV-Tools v2026.4. AI-assisted (Claude Code). The generator, model and mutation switches are about 400 lines of standard-library Python; I can post them if they are useful for the PR's own tests. |
AI-assisted. Preserve current main's runtime, CI and translator contract updates.
SHADER-638. Existing claim. Synthetic portability prototype for compute kernels that declare and use a full 65,536 B LDS and need Wave64 emulation.
The coordinator's RSRC2 census found zero 128-unit declarations among 2,689 indexed FSSM compute headers and 29 FSPX records. The two measured retail refusals use 64 units and are covered by #1882. This draft is for evaluating a general fallback and its execution cost. Updated to official main aa2988c, including the integrated SHADER-309 allocation checks. The native barrier-counter work in #3245 is independent.
Exchange timing
CPU gates
Validation after merging main
Integration at 29dc055 against main 1cc6e3c
Depends on: #1882 (merged).
AI-assisted (Codex).