Repository navigation
Conversation
…light/spirv The tool staged the chosen VS and PS containers in <work>/first_light/dxbc and had them translated into <work>/first_light/spirv, and emptied neither. fssm_unpack.py, shader_disasm.py and rdna2spirv.py take every file in the folder they are given, so a second run with another shader translated the first run's container again: "3 shaders: 2 translated" for a pair, the extra one with "stage ?", and its files stayed beside this run's. reset_run_folders() removes both folders at the start of translate() and creates an empty dxbc. first_light/out, another --out and <work>/shaders are not touched. A folder that is a symlink or a junction, or sits behind a linked first_light, is refused before anything is removed; a link inside is unlinked without being entered; a file that cannot be removed ends the run with one line naming it. tests/test_first_light.py: RunFolderTests runs the tool twice in one synthetic work folder, with stand-ins for the three tools that take every file like the real ones. docs/first_light.md says the two folders are per-run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Independent Windows check of 35fe778 against parent f847748. With synthetic shader files and stubbed tools, the parent fed first, leftover, second, and vertex into the second translation. This head fed only second and vertex and preserved the earlier output and the source shader directory byte for byte. All five focused tests passed. I found one gap in the documented junction refusal. If work/first_light is a junction and the destination contains neither dxbc nor spirv, stale is empty. The validation loop never runs, and os.makedirs creates dxbc in the junction destination outside the work folder. I reproduced this on Windows with a sentinel in a separate temporary directory. Please validate first_light before examining its children and add a case with neither staging child present. AI-assisted. |
…ies behind it Review of ItsNotRexed#3577: reset_run_folders() judged first_light only through the dxbc and spirv folders it found. When first_light is a symlink or a junction to a folder that has neither, there was nothing to judge, and the new dxbc was created in the folder the link points to, outside the work folder. first_light itself is now checked before its children. tests/test_first_light.py gains the case with neither folder behind the link (symlink and junction): it fails on the previous commit with "SystemExit not raised" and the far folder gets a dxbc; with the check the run is refused and the far folder stays empty. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@Vonsek thanks, that gap is real and is closed in On @shdann's finding in the coordination issue (two overlapping runs that share |
|
Tested
The branch is based on |
|
@sovljanskii thanks for the run on MoltenVK and for the independent test. Merged AI-assisted. |
|
Re-ran the package end to end on
AI-assisted. |
|
BUILD-1011 is already implemented on current main Validated current merged content: Closing this now-redundant PR as completed on main instead of keeping an empty PR open. CPU-only synthetic fixtures, no game files/GPU/driver. AI-assisted (Codex). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BUILD-1011, claimed in the coordination issue: #3381 (comment)
What and why
tools/first_light.pycopies the chosen VS and PS containers into<work>/first_light/dxbcand has them translatedinto
<work>/first_light/spirv. Neither folder was emptied between runs.fssm_unpack.py,shader_disasm.pyandrdna2spirv.pyeach take every file in the folder they are given, so a second run with another shader unpacked,disassembled and translated the first run's container again: the translator reported 3 shaders for a pair, the extra
one with
stage ?because it is not in the stagedindex.json, and its files stayed beside this run's.The change is one new function,
reset_run_folders(work), and one line intranslate()that calls it in place ofos.makedirs(dxbc, exist_ok=True). Nothing else in the tool is touched (choose(),main()and the output foldercode are as they were).
first_light/dxbcandfirst_light/spirvat the start of a run and creates an emptydxbc. Both holdonly copies from
<work>/shadersand files derived from them.first_light/out, any other--outand<work>/shadersare not touched.first_light, is refused with one line.Both folders are checked before either is removed. A link inside a folder is unlinked by
shutil.rmtreewithoutbeing entered.
docs/first_light.md(section 3) says the two folders are per-run.Behaviour to know about: a work folder whose
first_lightis itself a junction or symlink used to work and is nowrefused; a read-only or open file left in the two folders stops the run instead of being forced; an
--outplacedinside
first_light/dxbcorfirst_light/spirvwould be removed by the next run (the default isfirst_light/out).Overlap with open pull requests: a file-level three-way merge of #2893 (
8ee1e2ab) and #2906 (700a478b) with thisbranch gives the same single conflict each already has with
mainalone (#2893 in the--listcode oftools/first_light.py, #2906 at the end oftests/test_first_light.py), and none in the lines changed here.Measured
Two runs in one work folder, the second with another pixel shader; counts after the second run. CPU only.
mainf847748cfirst_light/dxbc/first_light/spirv3 FSSM blobs2 FSSM blobs3 shaders: 2 translated, 2 pass spirv-val,1 stage ?2 shaders: 2 translated, 2 pass spirv-val.dxbc/.fssm/.s/.spv/.spvasmThe real work folder was a scratch one holding the carve
index.json(26,503 entries) of the 1.0.2.1 package andthree containers:
VS_main_170e32e6_Wrapped,$PS_Rage_Untextured_14f8529b_Wrapped(run 1, the defaults) andanother
$PS_Rage_Untextured_*variant (run 2).vs.spv,ps.spvandindex.jsoninfirst_light/outhave the sameSHA-256 with and without the change, and the first run of each gives 15 files, so the 15 after the second run is what
a single run writes.
Tested
Windows 11 (26200), Python 3.14.0; llvm-mc and the SPIR-V tools of Vulkan SDK 1.4.363.0 for the real runs. No GPU is
involved: the runs prepare the folder and do not draw.
python -I tests/test_first_light.py: 16 tests, OK, 3 skipped (the package-gated draw tests, noLEONIDA_FIRST_LIGHT_DIR). The same file withmain'stools/first_light.py: 2 failures and 6 errors, all in thenew
RunFolderTests;test_a_second_run_holds_only_its_own_pairfails withLists differ: ['first', 'leftover', 'second', 'vertex'] != ['second', 'vertex'], the link tests withmodule 'first_light' has no attribute 'reset_run_folders'. Also OK on Python 3.12 and 3.13. 60 repeats ofRunFolderTestson Windows: no failure.python -I tests/test_first_light_bad_json.py: 9 tests, OK.python -m compileall -q make_game.py tools tests: exit 0.python -I tests/test_docs_links.py,test_docs_repo_paths.py,test_docs_list_items.py,test_docs_design_rows.py: OK.test_text_write_line_endings.py,test_csv_line_endings.py,test_ci_registration.py,test_tool_startup.py: OK.mklink /J). A separate probe on the same machine: a fileheld open and a read-only file in
first_light/dxbceach stop the run with one line naming the file, and the nextrun succeeds once the file is released.
python -I tools/first_light.py --game <package> --work <scratch work> --no-fit, then the same with--ps <the other variant>, withmain's tool and with this change in separate scratch workfolders, then both runs once more over the existing folders with this change (same counts). All exit 0.
Not checked: the draw (
--run,--check,d3d12_first_light), since nothing in the output folder or the harnesspath changes; Linux and macOS (the symlink case ran on Windows only);
tests/semantic(the translator is unchanged).The leftover
mesh.binof a run without an OBJ is a separate finding and is not changed here.Checklist
docs/design.md, with how it was confirmed. (Not a translator rule.)AI-assisted.