spirv_asm: refuse an output that aliases the source (OLD-10025) #1254

Closed
leonida/mandy
wetw0rks-c0ding wants to merge 0 commits from restore/old-10025-spirv-asm-alias into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

wetw0rks-c0ding commented 2026-11-24 20:55:44 +00:00

Claimed in the coordination issue as: OLD-10025

What and why

tools/spirv_asm.py would overwrite its input file if the requested output aliased the source, destroying the assembly input. It now refuses such an output and a regression test pins the behaviour.

Tested

  • python3 -m unittest tests/test_spirv_asm.py -> Ran 38 tests, OK (exit 0)
  • python -I scripts/check_no_game_data.py tools/spirv_asm.py tests/test_spirv_asm.py -> clean (exit 0)
  • Environment: Linux (CachyOS), CPU-only tests, no GPU required

AI-assisted: Yes. This work was done with OpenCode agents.

Claimed in the coordination issue as: OLD-10025 ### What and why `tools/spirv_asm.py` would overwrite its input file if the requested output aliased the source, destroying the assembly input. It now refuses such an output and a regression test pins the behaviour. ### Tested - `python3 -m unittest tests/test_spirv_asm.py` -> Ran 38 tests, OK (exit 0) - `python -I scripts/check_no_game_data.py tools/spirv_asm.py tests/test_spirv_asm.py` -> clean (exit 0) - Environment: Linux (CachyOS), CPU-only tests, no GPU required AI-assisted: Yes. This work was done with OpenCode agents.
fin-github commented 2026-11-24 21:48:47 +00:00

This makes the same change as #938 (SPIRV-ASM-INPUT-ALIAS), which was opened about 5½ hours earlier: the added lines in tools/spirv_asm.py and tests/test_spirv_asm.py are identical. They probably both come from old upstream PR 10025. Only one of the two can merge. Could we keep #938 and close this one? If you'd rather carry it, say so and I'll close mine. AI-assisted (Claude Code).

This makes the same change as #938 (`SPIRV-ASM-INPUT-ALIAS`), which was opened about 5½ hours earlier: the added lines in `tools/spirv_asm.py` and `tests/test_spirv_asm.py` are identical. They probably both come from old upstream PR 10025. Only one of the two can merge. Could we keep #938 and close this one? If you'd rather carry it, say so and I'll close mine. AI-assisted (Claude Code).
nicoco23 reviewed 2026-11-24 22:09:56 +00:00
nicoco23 left a comment
No description provided.
Reviewed the diff and ran the tests: `python -m unittest tests/test_spirv_asm.py` on Windows 11, Python 3.12, 38 tests, OK. The check is in the right place (right after argument parsing, before the source is read), exits with 2 through ap.error and leaves the source untouched. same_report_path resolves both paths with realpath and falls back to samefile, so the hard link and symlink subtests are real checks rather than string comparisons. Notes, none blocking: - The symlink and hard link subtests are skipped when the OS refuses them (typically symlinks on Windows without developer mode), so they may not run on every machine. - The test does not cover two paths that differ only by case on Windows or macOS. [same_report_path may already handle that through _resolved_key; a subtest would pin it.] - [One check is failing on the PR: <name>. It looks unrelated to this change / I did not look into it.] NOT AI-assisted review.
wetw0rks-c0ding commented 2026-11-24 23:33:12 +00:00

Closing this as a duplicate: another contributor's #938 (spirv_asm: refuse an output that aliases the source, SPIRV-ASM-INPUT-ALIAS / DRAFT-293) came first and is already merged. Thanks for the contribution.

Closing this as a duplicate: another contributor's #938 (spirv_asm: refuse an output that aliases the source, SPIRV-ASM-INPUT-ALIAS / DRAFT-293) came first and is already merged. Thanks for the contribution.
Sign in to join this conversation.
No description provided.