Repository navigation
fix(first-light): select same-stage shader variants by archive offset (BUILD-834) - #2893
jeremygold02 wants to merge 7 commits into
Conversation
|
Independent retail validation of 8ee1e2a on Windows, CPU only (AI-assisted). Across all 26,503 carve records, grouping by exact stage and display name produced 96 ambiguous VS groups (1,190 records), 672 PS (9,461), 10 GS (192), 599 MS (8,892), and zero CS. Of the ambiguous VS and PS groups, 95 and 671 respectively contained more than one distinct DXBC byte sequence. All 10,651 ambiguous VS/PS containers matched independent decompression at their indexed archive offsets. The real CLI listed all 14,337 VS/PS records with the expected selectors. For end-to-end packaging I ran the unmodified CLI on every offset in one seven-member PS group and one two-member VS group. All nine manifest offsets and FSSM digests matched the selected records. All nine packaged containers matched the archive bytes, and all nine packaged SPIR-V modules matched fresh, single-container translations from those archive bytes on the same revision and toolchain. The PS group included the only ambiguous VS/PS record whose file stem matched an existing SPIR-V file in the scanned work and temp outputs. Neither of its two historical files matched the current module byte-for-byte; their build provenance was not established. This verifies selected-module identity for nine offsets. No GPU draw, driver validation or rendered-output comparison was performed. |
|
Code read of AI-assisted review (Claude Code). |
|
Tested The base fails the four same-name/offset selection checks in the head tests. The head keeps the variants distinct. The three package-dependent tests were skipped. AI-assisted, synthetic inputs only. |
|
I closed the three previously skipped package-gated tests on the current PR head I recovered the documented static model from my 1.0.2.1 package and verified its OBJ SHA-256 against On native Windows Vulkan, the harness and the tool’s Hardware: Intel Core Ultra 7 265K; NVIDIA GeForce RTX 5070, driver 621.01, selected by both Vulkan draws; integrated Intel Graphics was also installed. Windows 11 Home 25H2 build 26200.9974, Python 3.12.10. Shader translation ran under Ubuntu/WSL using LLVM 21.1.8 and SPIRV-Tools 2026.1. The harness source matched this PR head. AI-assisted. |
|
Tested
Against my own copy of the 1.0.2.1 package and a draw on both GPUs, which the earlier checks did not have:
Not checked: a draw with a pixel shader chosen by offset from a same-name group, and |
|
Thank you for checking the same-name variants and reproducing the default draw on both the Ryzen iGPU and RTX 3070. I merged I rebuilt the Windows harness from the new head and reran the five suites. All 55 tests passed, including all three package-gated checks. The two diagnostic draws on the NVIDIA GeForce RTX 5070 (621.01) again produced identical readbacks with 12,804 of 16,384 pixels covered. The host CPU was an Intel Core Ultra 7 265K on Windows 11 Home 25H2 build 26200.9974. The updated PR description also records a separate CPU-only test that followed one mesh's own material pass through offset selection and translation. AI-assisted. |
|
Tested 8ee1e2a on NVIDIA GeForce RTX 2070 SUPER (driver 617.42), Windows 10, against a work folder built from my own 1.0.2.1 package (
Minor: AI-assisted. |
Keep the DDS-aware default pixel shader when no selector is supplied, and let an explicit name or archive offset override it. Exercise both paths through the CLI. Refs: ItsNotRexed#2893
|
Reviewed da5ef2e merged onto main de67135 on Linux (CPU only): fail Ran on the merge (python3.13 -I -m pytest -q): tests/test_first_light_shader_selection.py tests/test_first_light.py tests/test_ci_registration.py tests/test_docs_links.py tests/test_text_encoding.py: 5 failed, 46 passed, 4 skipped, 14 subtests passed. Failures:
Cause: main now has reset_run_folders() (tools/first_light.py, called at the top of translate), which removes /first_light/dxbc and /spirv before every run. The PR's helper stage_compiler_outputs() (tests/test_first_light_shader_selection.py, about line 46-55) pre-creates first_light/spirv with a fake index.json and then patches fl.run to a no-op, so the translator stage never recreates it, and the new reset deletes the staged files. The test needs to stand in for the compiler differently (for example patch fl.run with a function that writes the spirv folder and index.json when it sees the rdna2spirv.py call) after the reset, not before it. Needed: rebase on current main and fix the stub so the translator output is written by the patched run(), not pre-staged. Read of the rest of the diff (choose() with --vs-offset/--ps-offset, mutually exclusive groups, --list selectors, manifest "offset"): the selection logic itself looks right; duplicate offsets and wrong offsets give clear SystemExit messages, tested. No other defect found. No game files. |
|
Tested da5ef2e merged with main 98fa503 on Linux (Python 3.12.16): fail. The merge is clean, but the result breaks tests. The PR changes the signature of |
Accept offset selectors in the mesh test doubles and generate the selected shader outputs when the translator runs after cleanup. Keep the missing-metadata case on the second run. AI-assisted by GPT-6.2 Astra. Refs: ItsNotRexed#2893
|
Fixed both integration failures in d4ee053. I reproduced eight failing cases on the clean merge of the previous head
Verification. All eight tests in the three affected files passed, including six subtests. The broader Windows run covered all six First Light suites, shader carving, CI registration, documentation links, encoding and line endings. It reported 102 passed, 18 subtests passed, four symlink subtests skipped on both the pushed head and its clean merge with newer On Windows 11 with Python 3.12.10, I rebuilt the Vulkan harness from the integrated source and ran the retained 128 × 128 fixture on the NVIDIA GeForce RTX 5070, driver 32.0.16.2101. The CLI and direct harness covered 12,804 of 16,384 pixels and produced byte-identical readbacks matching the earlier reference. The CPU was an Intel Core Ultra 7 265K. Integrated Intel Graphics (driver 32.0.101.9150) was idle. The three changed test files use synthetic data only. AI-assisted by GPT-6.2 Astra. |
Desamodeth
left a comment
There was a problem hiding this comment.
Tested d4ee0538 merged with main (3faac557) on Windows, CPU only. A synthetic archive containing two VS and two PS variants with the same name produced four distinct offsets. All four stage pairs selected the expected container bytes. Ambiguous names and a pixel offset supplied for the vertex stage stopped before translation. The first-light, carver and CI-registration suites passed (82 passed, 9 skipped).
One diagnostic regression remains. In the carve index, set a listed entry’s offset to null or "0x20" and run first_light.py --list. Both produce a Python traceback at the :#x formatter. A missing offset still works. Please validate a present offset as an integer in both listing and selection, and report the index path and entry number on failure. AI-assisted.
Merge main's perspective camera defaults with archive-offset selection. Validate optional offsets before listing or selecting a shader and reject an incompatible camera vertex shader before translation. AI-assisted by GPT-6.2 Astra. Refs: ItsNotRexed#2893
|
Fixed the merge conflict and the reported malformed-offset diagnostic in
CPU verification. The four selector, malformed-index and mesh suites passed 19 tests and 20 subtests. On the trial merge, the six First Light suites plus carving, CI registration and encoding passed 113 tests and 125 subtests. Windows skipped four package/harness checks and four symlink cases. Ubuntu/WSL ran the six First Light suites, including the symlink cases, with 66 passes and four package/harness skips. Adding the repository-wide documentation-link and text-write checks exposed three failures that I reproduced on untouched Windows 11, Python 3.12.10, Intel Core Ultra 7 265K. Synthetic CPU fixtures only. The NVIDIA GeForce RTX 5070 (driver 32.0.16.2101) and Intel Graphics (driver 32.0.101.9150) were idle. AI-assisted by GPT-6.2 Astra. |
|
Tested eaa6291 on Linux, Python 3.12.16: pass
|
|
Tested eaa6291 on CPU-only, Pop!_OS 24.04 LTS (Linux x86_64 7.2.15), Python 3.12.3: pass Checks run (no game files, no GPU):
Minor code-review notes (non-blocking):
AI-assisted: yes |
isfcrctfs
left a comment
There was a problem hiding this comment.
Read eaa62913 on Linux (CPython 3.12.16): the selection change is correct.
tests/test_first_light_shader_selection.py 5/5; test_first_light_bad_json 10/10; test_first_light 47 ran, 4 skipped, 43 passed; test_first_light_mesh_draw and test_first_light_stale_mesh OK. tests/test_ci_registration.py 14/14, so the new file is picked up by the CI loop, and scripts/check_no_game_data.py is clean on the four changed files.
The logic reads right: choose() filters on stage plus field, a duplicated name is refused with the offsets to choose from, a duplicated offset gets its own error, and --camera re-checks the picked VS name before translate() is called, so a wrong --vs-offset cannot stage anything.
One cosmetic nit: type=lambda s: int(s, 0) (tools/first_light.py:930) makes argparse report argument --ps-offset: invalid <lambda> value: 'zz'; a named one-argument helper gives a readable name in that message.
No defect found. Not run: the package-gated GPU draw.
AI-assisted.
|
Tested
Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting; claimed in #8047. |
Select the documented UV program's readback expectations by its FSSM digest when a DDS remains bound. Apply the same rule on recheck of previously generated manifests. Exercise UV and copy frames with matching coverage through the public checker. Refs: ItsNotRexed#2893 AI-assisted by GPT-6.2 Astra.
|
At I ran the public
The ordinary UV and DDS-copy defaults each accepted their own output and rejected the opposite control on both revisions. All five tests in Windows 11 Home 25H2, Intel Core Ultra 7 265K, CPython 3.12. CPU-only synthetic test; no game input or GPU run. NVIDIA GeForce RTX 5070 (621.01) and integrated Intel Graphics were idle. Each test process was limited to 128 MiB and 10 seconds, and measured peak job memory stayed below 24 MiB. AI-assisted by GPT-6.2 Astra. |
|
Tested a1d4e13 on Arch Linux, Python 3.14.10, CPU only: pass. tests/test_first_light_shader_selection.py 5/5, bad_json 10/10, mesh_draw 3/3, stale_mesh 1/1, harness_paths 4/4, test_first_light.py 47 ran OK (4 skipped, package/GPU-gated). Negative control: merge-base tools/first_light.py fails shader_selection 3+4 and bad_json 12; restored, green again. Note: test_docs_links has 1 failure, proven pre-existing (identical on origin/main; anchor issue in docs/dev-tools.md, untouched by this PR). No game files. AI-assisted. |
Claimed as BUILD-834. Prerequisite #2419 has merged.
What changed
A vertex or pixel shader name can identify more than one program in the same stage. The old stage/name lookup silently kept the last entry. This change reports the matching archive offsets and lets the caller select the variant with
--vs-offsetor--ps-offset. Both accept decimal and hexadecimal values.--listshows offsets, the lookup checks the program stage, and the manifest records the selected offsets. Existing unique-name lookups continue to work. Reported package caseVerification at
10a45fddMerged upstream
f847748cinto the branch and retained the current carve-index validation in--list. The three changed files are the tool, its documentation and a synthetic regression suite.Windows 11 Home 25H2 build 26200.9974, Intel Core Ultra 7 265K, Python 3.12.10. Both GPU draws used the NVIDIA GeForce RTX 5070 (driver 621.01). Integrated Intel Graphics (32.0.101.9150) was idle. Ubuntu/WSL supplied LLVM 21.1.8 and SPIRV-Tools 2026.1. Game and derived files stayed local. AI-assisted.