Repository navigation
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Ran this at affed599 on Windows 11: python -I tests/test_feature_scan.py -> test_feature_scan: OK (0 failed checks, 0 failed tests); git diff --check clean.
The new symlink case itself skipped here (WinError 1314, no symlink privilege), so I checked inside_dir directly with a directory junction (no privilege needed):
inside_dir(alias/index.json where alias -> corpus): True
inside_dir(corpus, corpus): True
inside_dir(tmp/other.json, corpus): False
So the realpath leg resolves an aliased output into the corpus and the guard would exit 2; the abspath leg still covers the non-aliased case. The test's before/after index byte comparison is a good addition. No blocking issue.
|
The fix is correct, but its regression test does not run on Windows CI. Verified with a junction workaround: The gap: Minor: Approve with the test made portable. AI-assisted review, no game files, no GPU. |
|
Tested affed59 merged with main d0835dd (merge 4dae51e2d, no conflicts) on Linux (WSL2) Python 3.12.16 and native Windows 11 Python 3.13.1: pass.
|
DoubleD17
left a comment
There was a problem hiding this comment.
Reviewed 3d27679a341b700e573db7731dab1458ec795582. A report path outside dxbc can still overwrite dxbc/index.json when the two names are hard links to the same file. In tools/feature_scan.py:531, both the absolute and resolved report paths are outside the corpus. The same_path() check at line 535 only covers the SPIR-V index, so the direct open(..., "w") at line 613 truncates the carved index too.
On Windows 11 with CPython 3.13.3, I created a scratch dxbc/index.json containing [] and an ordinary hard link to it outside dxbc. abspath() and realpath() both keep the report path outside the corpus, while samefile() returns true. The upstream CLI exited 0 and replaced the list with its report object. A second scan of the same scratch directory exited 2 with is not a shader list. The control with a separate report file left the input unchanged. I ran the synthetic case against upstream d0835dd9, using the same feature_scan.py blob, and inspected the PR head statically.
Could you extend the input identity check to the carved index and add a regression that asserts exit 2 and unchanged input bytes for a hard-linked destination?
No game files. AI-assisted.
Claimed in the coordination issue as: New BUILD item
What and why
feature_scan.py --outcould overwrite the shader corpus index when the destination reached it through a symlink. The output guard now checks both the path as written and its resolved destination.Tested
python3 -I tests/test_feature_scan.pypassed on Linux. The new CLI regression failed before the fix and now verifies that the command exits with status 2 and leaves the index byte-for-byte intact. CPU-only, synthetic inputs.AI-assisted (Codex).
Checklist
docs/design.md, with how it was confirmed. (N/A — report output handling only.)