mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:00:52 +01:00
[PR #1423] pso_code_base_pairs: count PSOs by code-base stage (SHADER-CODEBASE-PAIRS) #1453
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1453
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1423
Author: @GTAVIB4GTAVI
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:feat/library-code-base-pairs📝 Commits (1)
7c2de8apso_code_base_pairs: count PSOs by code-base stage (SHADER-CODEBASE-PAIRS)📊 Changes
7 files changed (+398 additions, -11 deletions)
View changed files
📝
docs/boot.md(+1 -1)📝
docs/d3d12_vulkan.md(+18 -6)📝
docs/shader_library.md(+7 -1)➕
tests/test_pso_code_base_pairs.py(+179 -0)📝
tools/feature_scan.py(+2 -2)➕
tools/pso_code_base_pairs.py(+189 -0)📝
tools/shader_library.py(+2 -1)📄 Description
Item: SHADER-CODEBASE-PAIRS — claimed in #14 before this PR.
The question
docs/d3d12_vulkan.md§5.2 leaves the push-constant shape open: keep one 64-bit code base at dwords 34–35 in the144-byte block, or grow it to 168 bytes with one slot per stage, or use a per-stage buffer. It says to decide after
measuring how many real PSOs have two code-base stages. Row 14 of the
docs/boot.mdchecklist asks the same thing,and
tools/feature_scan.py's header says the package cannot answer it: "Which stages are paired in one PSO is in theexecutable, not in
shaders.rpf."It can. The pipeline library in
shaders.rpf's zlib part names a program per stage slot for all 25,471 graphicsrecords (
tools/shader_library.py), and a stage's resource-layout blob ends with the 16-byteHASHdigest of thecontainer its code came from — the same digest
shader_carve.pyleaves in every container it carved to<work>/shaders/dxbc, whose file stem is the translation index's key. Soand each stage of a PSO picks up that program's
uses_code_base.Answer: none, for 1.0.2.1
Over all 25,471 graphics records of library
0x65F41EDD930.048.020:The 444 are 343 MS, 60 PS, 41 VS. The stage census is 13,383 VS+PS, 10,726 MS+PS, 1,336 MS, 24 VS and 2 VS+PS+slot 6.
21 records (19 VS+PS, 2 with slot 6) are left unknown: a stage's program has no carved container in the carve output,
so its code base is unknown rather than absent. The tool's per-stage program counts (38 VS, 46 PS, 260 MS, 263 CS)
are lower than the corpus's published 54 / 93 / 266 / 263 of 26,503 because the library holds a second compiled form
of 6,522 carved shaders and one program can serve two stage slots; the corpus counts are reproduced by
tools/feature_scan.pyunchanged, so the join sees the same shaders.So the 144-byte block with one code base is enough for this package, and the runtime's refusal of a PSO whose two
stages both read it (section 3.2) can stay. The docs say that now, the stale
feature_scan.pyheader line iscorrected, and
tools/shader_library.py's header note about slot 6 matches the measured 2 records (both with VS+PS).Tool
tools/pso_code_base_pairs.py(standard library only,python -I), counts only — no shader name, listing, code ordata leaves the work folder:
Accepts the archive or a library saved with
tools/shader_library.py --save; reads bothspirv/index.jsonshapes(an object keyed by container stem, or a list of rows keyed by their own
file/name); a container carved under twostems counts as code-base if either row does;
--outrefuses to name one of its own inputs (report_paths).Testing
No GPU and nothing online. On Windows 10 Pro 22H2 (19045), Python 3.12.10, 16 cores, an RTX 2080 Ti that this change never touches:
python -I tests/test_pso_code_base_pairs.py— 9 tests, OK. The library, the carve folder and both index shapes arebuilt from bytes with the builders in
tests/test_shader_library.py: a VS+PS record with both stages on a codebase, an MS+PS record with only the PS, an unresolved record, a container carved twice, list- and map-shaped
indexes, archive and saved-library inputs, that the report names no shader, the
--outguard and a missing folder.python -I tests/test_shader_library.py(21) andpython -I tests/test_text_write_line_endings.py(3) — OK.python -m compileall -q tools tests, andpython -I scripts/check_no_game_data.pyon every file in the commit —clean.
tests/tree through the runner,python -I scripts/run_semantic_tests.py tests -j 4, at89d7dfcf5:plain reports 522 files, 8,099 tests, 42 files failed; with this commit 523 files, 8,108 tests, 42 files failed. The
two failed lists differ only by
test_run_wine_testsandtest_build_batch_launch, which pass alone here and failunder
-j 4on a loaded machine. The 42 are not touched by this commit: 30 are pytest-based filespython -Icannot import, 6 more are script-style files the runner collects nothing from (
ci.yml:87sends both kinds to thepytest job), and the rest are the Windows-only failures I filed as findings on #14. Rebased onto
6fe83805aafterthat; the re-run goes in a comment below.
AI-assisted. Counts only, no game data, per the coordination issue's rules.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.