Add slot-67 pipeline-library shader build and runtime loading #19
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!19
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/19/head"
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?
@moffington on GitHub · 2026-11-24 01:47 UTC · original
moffington:contrib/pipeline-library-upstream→main· +695 −15 · 9 files · 3 commits · merged 2026-11-24 02:27 UTCAdd slot-67 pipeline-library shader build and runtime loading
Summary
Completes the pipeline-library shader path by connecting build-time extraction and translation with runtime shader lookup.
library/index.jsonalongside existing FSPX/BVH indexes.library_shaders()to the game build pipeline, including caching, invalidation, and stale-artifact cleanup.TypeErrorwhen compute pipeline records contain aNONEstate index.Validation
shader_libraryCTest: pass.Limitations
Validation used synthetic shader inputs and a bounded Vulkan runtime fixture. Retail
shaders.rpfprocessing and live Windows D3D12 slot-67 execution have not been verified.One unrelated BVH test failure (
ShadersStageWithTheDlls) also reproduces on the original baseline.@wavehs on GitHub · 2026-11-24 02:06 UTC · original
macOS arm64 review (Apple M3 Pro) — the stage works, the crash it fixes reproduces exactly on base, and one build-time concern
Head
ee2b087b6, merge base30daa6958, 8 files +536/−11; it merges cleanly intoubi/main(9ec34cdff,git merge-tree --write-treerc=0). Host: macOS 27.2.1, Apple M3 Pro (arm64), CPython 3.15.2, Apple clang 21.0.0, CMake 4.5.0, MoltenVK 1.4.0 / KosmicKrisp (Mesa 26.3.0) for the GPU smoke.ee2b087b630daa6958/ubi/maintests/test_library_shaders_stage.pymake_gamehas nolibrary_shaders)tests/test_shader_library.pytest_compute_missing_state_removes_stale_state_and_skips_none_blobtests/test_fspx_shaders_stage.pytests/test_bvh_shaders_stage.pyShadersStageWithTheDlls…)cmake -S runtime -B build19 && cmake --build build19 -j8ctest --test-dir build19shader_library_corpuswantsLEONIDA_GAME_DIR,vk_sync_validation)./build19/shader_library_testwith baseruntime/src/shader_library.hsize() == 5 && fspx_size() == 4)run_gpu_tests.py --build build19 --filter cs_ldsscripts/run_semantic_tests.py tests/semantictest_exec_computed,test_image_atomics_guard, both present on main)The negative control is the crash itself, and it is exactly the one the PR describes. On base code:
that is
cs_state[i]holdingNonefrom a compute record whose state is0xFFFFFFFF. At this head the same input returns 0, leaves no.state, and omitsfspx_state_sha256, which the test checks throughshader_meta.fspx_state_sha256_file. The C++ half is pinned too: with the base header the new block fails on the first count, with this header it passes (… FSPX programs and index lookup OK), so the loader's newlibrary/folder is what makes it green rather than the test restating itself.One concern worth fixing before this lands: the new step translates ~2.7k programs on one core.
library_shaderscallspy("rdna2spirv.py", …)directly (make_game.py, thepy("rdna2spirv.py", os.path.join(unpacked, "disasm"), …)line), while the corpus usestranslate(), whose own docstring is "rdna2spirv.py runs on one core: start one--shardper job side by side, then merge their index parts" (make_game.py,def translate(). The step already receivesjobsand uses it forshader_library.py --jobs, so the unpacking is parallel and the translation is not. With the 2,684-program count your doc gives, that is a single-threaded pass over about a tenth of the corpus added to everyshadersbuild, on a stage whose corpus translation is already "the longest step".translate(disasm, spirv, jobs, emulate=emulate, fallbacks=fallbacks)would give the same output through the existing shard plan, andfspx_cache_completewould still see a complete index.Three smaller notes.
fspx_key_clashnow raisesValueErrorfor an index that is not a JSON object (the newraise ValueError("index.json must contain a JSON object")), andlibrary_shaderscatches(OSError, ValueError, TypeError)to fail cleanly. The other caller,fspx_shaders, still calls it bare, so an unreadable FSPX index is still a traceback (it was aTypeErrortraceback before, so nothing regresses). The new contract has two call sites and only one is guarded.docs/shader_library.mdsays "every compute program has exactly one (2,684 programs, 2,693 records)". That is a corpus measurement I cannot check here — no game files — and the doc does not say which archive or how it was counted. One sentence naming the source would let the next person redo the count.shaders.rpfis absent,library_shadersdeletesindex.jsonandlibrary_build.jsonbut leavesspirv/library/*.spvin place. Harmless (nothing loads without the index) and consistent with how the other steps drop only their markers, but it is the one stale output the rebuild cleanup does not reach.I also ran
check_no_game_data.pyover all eight changed files: clean.No game files. AI-assisted.
@moffington on GitHub · 2026-11-24 02:22 UTC · original
Thank you.
Addressed the serial translation concern in
642880a21by switchinglibrary_shaders()to the existing paralleltranslate()helper. Also added shard/cache regression tests, unified the FSPX index error handling, and clarified the shader count provenance.Verified byte-identical serial/parallel outputs, 70/70 C++ tests, and 8/8 RTX 3060 Vulkan fixture cases. The pre-existing BVH failure remains unchanged.
I left the unindexed
.spvcleanup behavior consistent with the existing BVH stage.