Repository navigation
BUILD-521: keep the SGPR census from overwriting its input index - #1861
Conversation
|
Reviewed and tested f8d185e: looks good. AI-assisted (Claude), on behalf of dev-ewann. CPU only, no GPU (WSL2 Ubuntu, Python 3.14.4, pytest 9.0.2).
Mutations of
A missing index still ends in the same traceback from |
lucastayaralvarenga-ui
left a comment
There was a problem hiding this comment.
Code review · #1861
Branch fix/user-sgpr-census-preserve-index · Author @FreddyxS · Open and mergeable · Commit f8d185ef
What changes
The census checks the report destination against the input by file identity before opening either for data I/O. This also covers relative aliases and hard links. Output identity check
Verification
-
Baseline. On
mainat6a6704df, using the input as the report returned 0 and replaced its bytes. The PR tests verify that same-path, relative-alias, and hard-link cases return 2 and preserve the input. -
PR head. 8 census tests passed, including the hard-link case on this Windows setup. I also tested the census files from a clean Git merge tree with my related PR #1832. All 9 tests passed in the combined tree.
-
Windows 11 Pro, Python 3.12.16, CPU-only tests with synthetic inputs.
git diff --checkpassed. GitHub checks were queued at review time.
Recommendation
Approve. The overwrite guard and argument validation in #1832 work together in the tested tree.
AI-assisted review with Codex.
Static review — PR #1861 (BUILD-521)Branch: (head of PR #1861) What it does
Changes
CPU test results
Reviewer recommendationApprove. Small, correct fix with proper tests covering path aliasing and hard links. Matches the pattern used in other tools (e.g., world_names.py's AI-assisted. Reviewed with Claude Code. |
BUILD-521 claim in #1745.
What changed
user_sgpr_census.py --jsoncan replace the translator index with its summary when the report path refers to the same file. Compare the file identities before reading or writing and report a usage error for a match. A separate report path still works.Verified
003e7812and pass with this change. The input stays byte-for-byte identical and the tool reports exit code 2. A separate report still succeeds.pyteston the census, shader metadata and shader profile tests reported 56 passed, 1 skipped and 110 subtests passed. The hard-link case was skipped because the local environment denied link creation.compileall,git diff --checkand merge checks againstmain, user_sgpr_census: validate stage assignments before scanning #1832 and tools: text reports are written with LF line ends on every platform (BUILD-468) #1615 passed. The published branch tree matches the tested tree.Synthetic files, CPU only. AI-assisted (Codex).