fix(tools): read a captured environment key comparison #24928

Merged
relativespace2K merged 1 commit from upstream-pr/24928 into main 2026-11-21 12:03:59 +00:00
relativespace2K commented 2026-11-21 11:20:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by relativespace2K on 2026-11-21T11:20:24Z.


What

env_reference.py only recognized direct environment readers, so the captured-environment comparison at PerformanceTrace.hpp:694 (entry.first == "APS5_TRACE_ALL_PHASES") was not seen and python tools/env_reference.py --check reported the documented option as stale.

The scanner now treats <identifier>[<index>].first == "APS5_…" as a string read. The name stays attributed to the file and line that consume the key, and unrelated comparisons such as pair.first == "NOT_AN_ENV" are ignored because the literal must carry a tracked prefix.

Tested

  • python tools/env_reference.py --check: 712 names, all documented (was 1 stale, exit 1).
  • New regression in tools/tests/test_env_reference.py covers entry.first and summary.environment[index].first, and checks an unprefixed literal is not a read.
  • python -m unittest tools.tests.test_env_reference: 54 tests pass.
  • python tools/check_conventions.py --base origin/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: Fixes #24926
  • Unblocks: none
  • GPUs tested: none (no GPU required)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5427267362 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24928). Originally posted by [relativespace2K](https://github.com/relativespace2K) on 2026-11-21T11:20:24Z. --- ### What `env_reference.py` only recognized direct environment readers, so the captured-environment comparison at `PerformanceTrace.hpp:694` (`entry.first == "APS5_TRACE_ALL_PHASES"`) was not seen and `python tools/env_reference.py --check` reported the documented option as stale. The scanner now treats `<identifier>[<index>].first == "APS5_…"` as a string read. The name stays attributed to the file and line that consume the key, and unrelated comparisons such as `pair.first == "NOT_AN_ENV"` are ignored because the literal must carry a tracked prefix. ### Tested - `python tools/env_reference.py --check`: 712 names, all documented (was 1 stale, exit 1). - New regression in `tools/tests/test_env_reference.py` covers `entry.first` and `summary.environment[index].first`, and checks an unprefixed literal is not a read. - `python -m unittest tools.tests.test_env_reference`: 54 tests pass. - `python tools/check_conventions.py --base origin/main` passes. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: Fixes #24926 - [x] Unblocks: none - [x] GPUs tested: none (no GPU required) - [x] AI-assisted: yes
MarcZX10 commented 2026-11-21 11:41:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T11:41:19Z.

Review: COMMENTED


Reviewed — no blocking findings

The scanner change is consistent with the described captured-key comparison and its regression coverage; I did not run the reported checks, so this review does not support a formal approval.

What I ran

No commands were run. I read the PR description, commit summary, manifest, diff, and targeted ranges of both changed files through repo_read.py at head 4d4227dbe0a1206d2369da312b15005c9436376a.

Results

Check Result Note
Diff and targeted code review passed New pattern and call path inspected
Reported tests and conventions check not run Results are author-reported

Findings

Blocking

None identified in the code inspected.

Non-blocking

None.

Not verified

The reported environment comparison, 54 unit tests, and conventions check were not run. I read targeted ranges only, not the full text of either changed file; the remaining portions of tools/env_reference.py and tools/tests/test_env_reference.py were not verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6004986799 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24928#pullrequestreview-6004986799). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T11:41:19Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The scanner change is consistent with the described captured-key comparison and its regression coverage; I did not run the reported checks, so this review does not support a formal approval. ## What I ran No commands were run. I read the PR description, commit summary, manifest, diff, and targeted ranges of both changed files through `repo_read.py` at head `4d4227dbe0a1206d2369da312b15005c9436376a`. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted code review | passed | New pattern and call path inspected | | Reported tests and conventions check | not run | Results are author-reported | ## Findings ### Blocking None identified in the code inspected. ### Non-blocking None. ## Not verified The reported environment comparison, 54 unit tests, and conventions check were not run. I read targeted ranges only, not the full text of either changed file; the remaining portions of `tools/env_reference.py` and `tools/tests/test_env_reference.py` were not verified. ## To get this to a good state Nothing is required.
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
boykopovar/AnyPS5!24928
No description provided.