Skip to content

Report missing required translator inputs and retire stale outputs - #6292

Merged
shayderrr merged 3 commits into
ItsNotRexed:mainfrom
kacper-serewis:fix/required-compute-sidecar
Nov 23, 2026
Merged

shayderrr merged 3 commits into
ItsNotRexed:mainfrom
kacper-serewis:fix/required-compute-sidecar

Conversation

@kacper-serewis

Copy link
Copy Markdown
Contributor

Coordination claim 7102982730 on #6214. Independent of #3018, #5586, #5688 and #6161. No PR dependencies.

On main at 561b65a, the standalone CLI stopped at the first missing required input. A private CPU batch selected the same 32 listings as the #3018 validation run. Main wrote 16 modules before the traceback and left the fresh directory without an index. Running each separately identified two missing compute dispatch reads and three missing native-code reads for instruction re-anchoring.

The CLI now names each failed input, drops its old module and index entry, continues through the selection, and returns 1 after reporting the counts. An incomplete shard removes its part so resume retries it. The translation rules and optional sidecar fallbacks stay in place.

On the same private batch the CLI translated 27/32, validated all 27, indexed 27 and reported five missing inputs with exit 1. Synthetic tests cover stale entries, a later valid listing with no native sidecar, and incomplete shard retry. Windows CPU only, Vulkan SDK 1.4.363.0. No raw game package, GPU or GPU driver used.

Passed 34 translator CLI tests, seven wave-size tests, three text line-ending tests, compileall, isolated make_game.py --help and git diff --check. AI-assisted with Codex.

@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested e27c422 on Windows, CPython 3.14.7, CPU only: pass.

I ran the CLI with two synthetic listings, cs_dispatch and ps_fixture. Each contained s_endpgm. I omitted the compute dispatch sidecar and seeded the output with an old cs_dispatch.spv and index entry.

  • The head returned 1 and reported one missing input out of two. It removed the old module. The index contained only ps_fixture. A separate spirv-val run accepted ps_fixture.spv.
  • The merge base (561b65a) also returned 1, but it stopped with FileNotFoundError. It kept the stale module and index entry. It produced no pixel module.

I ran tests/test_rdna2spirv_cli.py, tests/test_fssm_wave_size.py and tests/test_text_write_line_endings.py with py -3.14 -I. In total, 43 tests passed and one skipped. Both new regression tests failed against the merge-base implementation.

AI-assisted.

@SirKingg SirKingg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: two reproducible stale-index cases on the standalone shard CLI.

  1. tools/rdna2spirv.py:17346-17352,17403-17406: seed index.part0.json and shard0.json for a completed shard, then retry --shard 0/1 with a missing compute dispatch input followed by a pixel input whose .dxbc path is a directory. On Windows the first shader's old module is deleted, but opening the directory raises PermissionError before the end-of-loop part unlink. Both old markers remain, and --merge succeeds and republishes an index referencing the deleted module. A resume with a matching make_game plan also considers that shard complete. Invalidate the completion part before mutation or on every unsuccessful exit, including unexpected read errors/interruption.

  2. tools/rdna2spirv.py:17351,17403-17406: even when the missing-input run reaches its normal exit 1 and removes its part, a pre-existing index.json remains published while its referenced .spv has been deleted. A direct shard invocation therefore leaves a stale complete index until a later merge is attempted. Please invalidate or update the published index when retiring a module in shard mode, while preserving unrelated outputs.

Independent Windows CPU validation at e27c422: python -I tests\test_rdna2spirv_cli.py -v 34 passed; python -I tests\test_rdna2spirv_merge.py 30 passed; python -I tests\test_make_game_resume.py 14 passed; python -I tests\test_fssm_wave_size.py 7 passed; python -I tests\test_text_write_line_endings.py 3 passed; git diff --check passed. Synthetic real-CLI controls: absent optional sidecar translates, missing dispatch removes the part and module, repair followed by retry and merge succeeds, and an isolated Windows directory-read PermissionError preserves its prior module/index. Directory-read denial is not an ACL-denial test. No game files or GPU were used; no corpus or GPU validation was run. AI-assisted.

@Kev-Ball

Copy link
Copy Markdown

Exercised the failure → repair cycle at e27c422e on 16 retail listings (8 compute, 8 pixel) with their original containers in a private scratch input tree. The healthy CLI run translated and validated 16/16. With three compute FSSM sidecars withheld, the retry exited 1, retired exactly those three SPIR-V files and index entries, and preserved the other 13 binaries and metadata. Restoring the sidecars and retrying reproduced the entire healthy index and all 16 binaries byte-for-byte.

I also repeated the test after a successful two-shard merge. With one compute sidecar withheld, its shard exited 1 and removed its part. The other part stayed byte-identical. A merge while incomplete exited 2. Restoring the input and rerunning just the affected shard allowed the merge to succeed and reproduced the original 16-entry index. CachyOS x86-64, Xbox 1.0.2.1, CPU only, AI-assisted.

@kacper-serewis

Copy link
Copy Markdown
Contributor Author

SHADER-1048 review follow-up at be4c89c4f. A shard retry now withdraws its completion part and the merged index before scanning the listings. The shard count remains available to merge, and resume can reuse the other completed parts. Windows also reports a missing SPIR-V executable through the existing setup-error path.

I reproduced the failure through the production CLI on Windows CPU at e27c422ea. Two synthetic pixel listings validated in separate shards and merged into two entries. After changing the first listing, hiding SPIRV-Tools from PATH caused both the external-assembler retry and the Python-assembler retry to fail. In each case standalone --merge still returned 0 and reproduced the previous index byte-for-byte.

At the new head, each missing-tool retry returns 2 and withdraws the merged index immediately. A subsequent merge returns 2. The previously validated binaries and the healthy shard’s part and marker remain byte-identical. Restoring the tools and rerunning only the affected shard changes its binary, and the final output files match a fresh two-shard build byte-for-byte.

The CLI regression also exercises the review’s missing compute input followed by a directory at the pixel container path. Both the ordinary missing-input exit and the interrupted retry retire the compute module, remove the part and merged index, and preserve the previous pixel binary.

Windows, Python 3.13.15, Vulkan SDK 1.4.363.0. Passed 35 CLI, 30 merge, 14 resume, 7 wave-size, and 3 line-ending tests, plus compileall, isolated make_game help, and diff whitespace checks. Synthetic inputs, CPU only. AI-assisted.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary: tools/rdna2spirv.py::main() now catches FileNotFoundError per listing, prints ERROR: <name>: missing translation input <path>, retires the stale .spv/index entry via drop_stale(), continues the batch, and returns 1 with a missing-input count. An incomplete shard deletes its index.partN.json so resume retries it. tests/test_rdna2spirv_cli.py adds tests for named failures, stale output removal, valid later listings, and shard invalidation.

Why merge: A batch with a missing native or sidecar input now reports every affected shader and leaves no publishable stale module instead of aborting at the first error.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary: tools/rdna2spirv.py::main() now catches FileNotFoundError per listing, prints ERROR: <name>: missing translation input <path>, retires the stale .spv/index entry via drop_stale(), continues the batch, and returns 1 with a missing-input count. An incomplete shard deletes its index.partN.json so resume retries it. tests/test_rdna2spirv_cli.py adds tests for named failures, stale output removal, valid later listings, and shard invalidation.

Why merge: A batch with a missing native or sidecar input now reports every affected shader and leaves no publishable stale module instead of aborting at the first error.

Verdict: Approve

@shayderrr
shayderrr merged commit e835ce6 into ItsNotRexed:main Nov 23, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants