Repository navigation
Conversation
|
Tested 80f9189 on Intel UHD Graphics 630 (CFL GT2), Mesa ANV, subgroup 8..32: the full run_gpu_tests.py suite prints "167/232 passed, 63 skipped" with FAIL cs_fmt_int_narrow ("word 34: expected 0xffffffff, got 0x00000000") and FAIL cs_signed_zero_nan, the same two FAIL lines these fixtures give on 561b65a on this GPU. --filter bvh passes 2/2 (cs_bvh, cs_bvh32) and fails with "no Vulkan physical device matches" under LEONIDA_VK_DEVICE=NoSuchDevice. test_shader_sidecar_io runs 4 tests OK and test_shader_meta*.py 32 tests OK. Translator output was not compared byte for byte, so the SPIR-V hash claims are not checked. AI-assisted. |
|
Independent synthetic cache-isolation review at exact head |
Kam471
left a comment
There was a problem hiding this comment.
Reviewed at 80f91898d on Windows 11 / Python 3.13.
python -I -m pytest tests/test_shader_sidecar_io.py -q: 4 passed.test_shader_meta.py,test_shader_meta_operands.py,test_fssm_header.py: 74 passed, 62 subtests passed.- Byte-identity on a 221-shader sample (CS/PS/VS listings with
.fssmand.dxbcsidecars): SHA-256 of every emitted SPIR-V assembly and everyshader_meta()JSON matched main561b65a83; the combined digest wasE64BED82...on both trees. - Timing, five alternating warm runs of the same 221 shaders: head median 0.315 s, main median 0.590 s (-46.6%). The exact -29.6% claim depends on the input corpus, but the direction and scale reproduce.
shader_ir.parse_file()now hashes the bytes it already reads; explicit alternatesrc_path/fssm_pathstill hash the alternate files, and helper signatures keep their defaults.
Verdict: LGTM. Overlaps: conflicts with open #4642 in tools/rdna2spirv.py; merges cleanly with #5820/#5832.
|
Rebased cleanly onto current origin/main (c4cd71b); one conflict in tools/rdna2spirv.py resolved by keeping main's cache_active/exec_static_true alongside the sidecar dedup. New head 7d47b4c. Passing: test_shader_sidecar_io (5), test_shader_meta (27), test_shader_ir_parse (3), test_shader_ir (37); git diff --check clean. |
72efd9c to
7d47b4c
Compare
|
Checked the rebased head For The full-corpus run that started before the rebase has also finished. At FSPX retest after the rebase to Across that same input set, calls to |
|
First pass on head
Not done: no GPU run (the SPIR-V is byte-identical to the parent), and I did not repeat the unreadable-sidecar check of the inline thread. Windows 11, Python 3.14.7. Repository fixtures and hand-written listings only, no game files. AI-assisted (Claude Code). |
7d47b4c to
506182f
Compare
506182f to
2e267fb
Compare
|
Rebased cleanly onto Thanks @shdann and @Kev-Ball for the full-corpus verification of this change. |
|
Tested 2e267fb on Steam Deck LCD (Jupiter), AMD Custom GPU 0405 "Van Gogh", RADV Mesa 26.2.0-devel (git-5c65d4fc31), Vulkan 1.4.350, SteamOS 3.9.5 (holo), kernel 7.2.7-valve2-2-neptune-72-g31504582a073: pass Command:
AI-assisted (OpenCode) |
|
Tested 2e267fb plus #8405 on main dfe4e4a. The only overlap was the source read in shader_ir.parse_file. I kept this PR's single binary read, hashed those bytes verbatim, and decoded them with utf-8-sig for parsing. All 130 sidecar, parser, shader metadata, FSSM-header and printed-encoding tests pass on Windows (CPython 3.15.2) and WSL2 (3.14.7). I also compared the same synthetic shader with and without a UTF-8 BOM. The emitted assembly and all metadata other than src_sha256 match. Each src_sha256 matches its exact input bytes, including the BOM where present. The combined tree still rejects a mismatching instruction at its original offset. Synthetic inputs, CPU only. AI-assisted (Codex). |
|
Tested 2e267fb merged onto main dde82f2 on Apple M4, macOS 27.2.1, Python 3.15.2 and 3.12.16: needs changes. The output is byte-identical, but the new test file fails on macOS. On this machine the change gives no measurable speedup on real shaders.
AI-assisted. |
Co-Authored-By: Gemini 4 Neon <noreply@google.com>
|
Thanks @sovljanskii for the thorough macOS review and mutation pass! Pushed $sha:
Verified \ est_shader_sidecar_io.py\ (6/6), \ est_shader_meta.py, \ est_fssm_header.py, and \compileall. AI-assisted. |
|
Tested on Apple M1 Max, macOS 27.2.1 arm64, Python 3.12.16: |
|
Tested 700ab15 on Arch Linux + RTX 4070, CPU + GPU: pass, first Linux check on this head. tests/test_shader_sidecar_io.py 6/6 OK. Negative control: merge-base tools fail 2; restored, 6/6 green. GPU: mask family fixtures pass on the card with the PR's translator (7 passed, 5 wave64-only skips as designed on this 32-wide device), so the single-read caching doesn't change outputs. No game files. AI-assisted. |
|
Tested Environment notes: pre-built
|
|
Tested 700ab15 on AMD Radeon RX 5700 XT (RDNA1), Mesa RADV 26.2.5, Linux (CachyOS 7.3), i7-7700K: pass
AI-assisted (Claude Code), run by a person; built and run in a sandbox without network. |
What and why
During
rdna2spirv.translate()+shader_meta(), each shader repeatedly resolvedos.path.realpath()(6–7 times per shader) and re-opened its.slisting (up to 3 times),.fssm/.code/.jsonsidecars (3–4 times), and.dxbccontainer (2–3 times). On Windows this accounted for nearly 30% of total CPU translation time.tools/shader_ir.py:parse_file()reads the.sfile once in binary mode and recordssrc_sha256alongsidecode_start/code_end.tools/rdna2spirv.py: introduces a per-shader_ShaderSidecarscache insidetranslate()sorealpath()and each sidecar read happen at most once per shader; reuses the cached source and FSSM hashes inshader_meta()when the same path is passed. All public helper functions keep their existing signatures and default behavior.tools/shader_meta.py:collect()accepts optional pre-resolvedroot,fssm_bytes,code_bytes, anddxbc_byteskeyword arguments while preserving existing defaults for direct callers.tests/test_shader_sidecar_io.py: regression tests pinning single-open / single-realpathcounts for CS and PS shaders with.fssm+.dxbcsidecars, explicit alternate-path hashing inshader_meta(), and direct helper compatibility.Claimed in coordination issue #5581.
Tested
main561b65a83across all 221 synthetic shader listings (1 warm-up + 5 alternating process pairs):translate()+shader_meta()wall-clock time fell from 2.219 s to 1.563 s (−29.6%) (base[2.118, 2.143, 2.219, 2.220, 2.270], head[1.531, 1.552, 1.563, 1.595, 1.616]).open()calls fell from 1,636 to 895 (−45.3%);os.path.realpath()calls fell from 1,427 to 222 (−84.4%).6d7529f5...) and all 221shader_metaJSON dicts (53f11caa...) matched byte for byte.221/221translated and passedspirv-val, with all 221.spvbinaries andindex.jsonbyte-identical tomain.test_shader_sidecar_io.py(4/4 OK; fails onmainwith 6–7realpathcalls),test_shader_meta.py(27/27 OK),test_shader_meta_operands.py(5/5 OK),test_fssm_header.py(42/42 OK),compileall,scripts/check_no_game_data.py, andgit diff --checkall pass.AI-assisted. Synthetic inputs only, no game files.