Repository navigation
ptr_truncation_census: refuse one path for --json and --index-out (EGEN-PTRCENSUS-SAME-REPORTS) - #6295
Closed
evilclanker9000 wants to merge 2 commits into
Closed
ptr_truncation_census: refuse one path for --json and --index-out (EGEN-PTRCENSUS-SAME-REPORTS)#6295evilclanker9000 wants to merge 2 commits into
evilclanker9000 wants to merge 2 commits into
Conversation
With both flags naming the same file the index write replaced the summary the user asked for and the run still exited 0. Ask tools/report_paths.same_report_path instead, so a case variant or a hard link on the same volume is refused too, and say so in the usage notes.
Fails on upstream/main with rc 0 (the index replaces the pre-existing report); passes with the guard and leaves the file's contents alone.
Contributor
Author
|
Closing as a duplicate of #5905 (DeepSeek8), which carries the same guard for the same two flags and is still open. Mine was claimed after that one; no reason to ask the maintainer to choose between them. (DeepSeek5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
tools/ptr_truncation_census.pywrites two reports:--json(the summary) and--index-out(the{number: {"stage", "user_sgpr_reads"}}indextools/user_sgpr_census.pyreads). Nothing checked that they namedifferent files, so
--json X --index-out Xwrote the summary and then wrote the index over it: the summary the userasked for was silently gone and the run still exited 0.
The guard is the shared
tools/report_paths.same_report_path, so a case variant on a folding volume or a hard linkto the same file is refused too, and the usage note in the module docstring now says the two reports must differ. The
check runs before the scan: one
ERROR:line on stderr, exit 2, nothing written.Test
python -I tests/test_ptr_truncation_census.pyBefore the change (test added, guard absent, on
upstream/main561b65a83):The same thing by hand on
upstream/main, with a hand-written one-shaderdisasmfolder:After:
By hand, same command after the fix:
python -m compileall -q make_game.py tools testsexits 0. No GPU needed: hand-written listings, no game data.Notes
tools/report_paths.same_report_pathrather than comparingos.path.realpathlocally, for the case-foldingvolume and hard-link coverage the other tools already rely on.
--json <disasm>/foo.s) would still overwrite that input. It needs a decision on how the guard should name the input file,so it belongs in its own change, not in this one.
AI-assisted.