spirv_asm: refuse an output that aliases the source (SPIRV-ASM-INPUT-ALIAS) (DRAFT-293) #938

Merged
fin-github merged 1 commit from upstream-pr/938 into main 2026-11-24 21:03:44 +00:00
fin-github commented 2026-11-24 15:17:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fin-github on 2026-11-24T15:17:28Z.


Claimed in the coordination issue as: DRAFT-293 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135362620)

Supersedes draft #293, carried over from the original repository. This is the same commit rebased onto current main, with the original author (Igor Borges) kept and git cherry-pick -x recording where it came from. The change and its explanation are theirs; see #293 for the original description.

Rebase note: one conflict in the imports of tools/spirv_asm.py, where main now imports more names from spirv_asm_tables. I kept main's import and added from report_paths import same_report_path above it.

Tested

  • python -I tests/test_spirv_asm.py: OK (1 skipped)
  • python -I scripts/check_no_game_data.py on the changed files: clean.

Windows 11 (10.0.26200), Python 3.14.4. No game files, nothing online.

AI-assisted (Claude Code): rebasing, conflict resolution and test runs.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5474960753 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/938). Originally posted by [fin-github](https://github.com/fin-github) on 2026-11-24T15:17:28Z. --- Claimed in the coordination issue as: `DRAFT-293` (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135362620) Supersedes draft #293, carried over from the original repository. This is the same commit rebased onto current `main`, with the original author (Igor Borges) kept and `git cherry-pick -x` recording where it came from. The change and its explanation are theirs; see #293 for the original description. Rebase note: one conflict in the imports of `tools/spirv_asm.py`, where `main` now imports more names from `spirv_asm_tables`. I kept `main`'s import and added `from report_paths import same_report_path` above it. ### Tested - `python -I tests/test_spirv_asm.py`: OK (1 skipped) - `python -I scripts/check_no_game_data.py` on the changed files: clean. Windows 11 (10.0.26200), Python 3.14.4. No game files, nothing online. AI-assisted (Claude Code): rebasing, conflict resolution and test runs.
KernelSmoker commented 2026-11-24 15:21:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T15:21:24Z.

Review: APPROVED


Reviewed exact head 4458c2a8b1978385ae8c20bb02d583b6ba0e224c. The CLI compares source and output via the shared same-path helper before opening either file, and regression cases cover identical spelling, .. normalization, hard links and symlinks while asserting source bytes remain intact. python3 -I tests/test_spirv_asm.py -v: 38 tests, 37 passed and 1 skipped because spirv-as is unavailable. Python compile and diff checks passed. No game data or GPU used.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6042073327 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/938#pullrequestreview-6042073327). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-24T15:21:24Z. **Review:** APPROVED --- Reviewed exact head `4458c2a8b1978385ae8c20bb02d583b6ba0e224c`. The CLI compares source and output via the shared same-path helper before opening either file, and regression cases cover identical spelling, `..` normalization, hard links and symlinks while asserting source bytes remain intact. `python3 -I tests/test_spirv_asm.py -v`: 38 tests, 37 passed and 1 skipped because `spirv-as` is unavailable. Python compile and diff checks passed. No game data or GPU used.
QemmHD commented 2026-11-24 21:03:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T21:03:41Z.


Merging.

Why merged: DRAFT-293: spirv_asm refuses an output path that aliases its source, so it can't overwrite its own input. It carries Igor Borges' original commit. KernelSmoker approved this exact head.

Why it's good: It reuses report_paths.same_report_path, which is already a registered translator input. Own tests: 38 passed, 1 skipped (spirv-as not installed here).

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 66d4f5aa3. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 573 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 0b45fdc21: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new env vars or build/CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7144422566 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/938#issuecomment-7144422566). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T21:03:41Z. --- Merging. **Why merged:** DRAFT-293: spirv_asm refuses an output path that aliases its source, so it can't overwrite its own input. It carries Igor Borges' original commit. KernelSmoker approved this exact head. **Why it's good:** It reuses report_paths.same_report_path, which is already a registered translator input. Own tests: 38 passed, 1 skipped (spirv-as not installed here). Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 66d4f5aa3. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 573 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 0b45fdc21: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new env vars or build/CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!938
No description provided.