mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #1686] translate_pipeline_compute: harden index parsing, published .spv mode, and worker cleanup #1700
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#1700
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/1686
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/translate-pipeline-compute-io-and-worker📝 Commits (1)
6f2fd66translate_pipeline_compute: harden index parsing, published .spv mode, and worker cleanup📊 Changes
2 files changed (+191 additions, -27 deletions)
View changed files
📝
scripts/translate_pipeline_compute.py(+63 -27)📝
tests/test_translate_pipeline_compute.py(+128 -0)📄 Description
Item ID:
TRANSLATE-PIPELINE-COMPUTE-IO-AND-WORKER(claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156665714)Summary
scripts/translate_pipeline_compute.py):load_compute_names(index_path)supporting UTF-8 BOM (utf-8-sig), validating JSON list/dict structure andstage/filetypes, rejecting empty-stem".dxbc"filenames and path separators (/and\), and reporting errors viaap.error()instead of raw tracebacks.index.jsonbefore mutating process priority (os.setpriority) orRLIMIT_AS(resource.setrlimit), and acceptargv=Noneinmain().args.compact_spirvexplicitly in cachesettings..spvpermissions & cache directory creation:out / ".compute-cache"is created withparents=True, exist_ok=Truein bothbuild_one()andbuild().file_mode.published_mode()before replacing published.spvfiles so they do not inherit0o600permissions fromtempfile.TemporaryDirectory.build():KeyboardInterrupt), sendSIGTERMto the forked child beforeos.waitpid(pid, 0)and do not raise"second translation worker failed"insidefinally, preventing the child's exit status from masking the parent exception.tests/test_translate_pipeline_compute.py):ComputePipelineUnitTests(runs on macOS & Linux without requiringspirv-as/spirv-val) covering BOM & malformedindex.json,build_one()cache creation +published_mode, parent-exception preservation +SIGTERM/waitpidcleanup vs child-only failure, and upfront validation beforesetrlimit/setpriority.Checklist & Verification
python3 -I scripts/check_no_game_data.py scripts/translate_pipeline_compute.py tests/test_translate_pipeline_compute.pypassed)python3 -W error -I tests/test_translate_pipeline_compute.py -v:Ran 5 tests ... OK (skipped=1)ComputePipelineUnitTestsagainst unpatchedmainscripts/translate_pipeline_compute.py):Ran 4 tests ... FAILED (errors=4)python3 -m compileall -q make_game.py tools tests scripts: passedpython3 -I tests/test_text_write_line_endings.py:Ran 3 tests ... OK🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.