env_reference falsely flags captured APS5_TRACE_ALL_PHASES as stale #24926

Closed
opened 2026-11-21 11:17:50 +00:00 by vgpastor · 0 comments
vgpastor commented 2026-11-21 11:17:50 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by vgpastor on 2026-11-21T11:17:50Z.


What happens

python tools/env_reference.py --check rejects the documented APS5_TRACE_ALL_PHASES option as stale, although TraceFormat::Summary consumes it from the captured summary.environment. Removing the documentation would hide a supported option.

Title, test or build step

The environment-reference consistency check; introduced alongside the captured-environment read in #18243. This is a tooling false positive, not a rendering or title failure.

AnyPS5 commit

Main 133008c0ee976fe44ada669a332edc9c7f088074. Also observed while validating the unrelated presentation branch 6a385ddd5c06e67600a6e0350bca64f9face9b53, whose only runtime change is a guard for APS5_NO_PRESENT_QUEUE. The trace reader and scanner are identical to main.

System

Windows 11 Pro 10.0.26300. Full check with native Python 3.14.10; isolated reproduction with Python 3.10. GPU/compiler are not used by the reproduction (host GTX 1060 3GB, NVIDIA 581.80).

Steps to reproduce

On the main revision above:

python tools/env_reference.py --check

The same false positive can be reproduced without scanning the repository: create a source directory containing one .cpp with the actual reader expression,

const bool allPhases = std::any_of(summary.environment.begin(), summary.environment.end(), [](const auto& entry) { return entry.first == "APS5_TRACE_ALL_PHASES" && entry.second == "1"; });

and a reference document containing its table row, then run:

python tools/env_reference.py --check --root <source-directory> --doc <reference-document>

The one-row document can be:

| `APS5_TRACE_ALL_PHASES` | string | `Read.cpp` | | `1` adds every phase total to the trace summary |

Log

error: APS5_TRACE_ALL_PHASES has a row in docs/dev/ENVIRONMENT.md but the code no longer reads it
0 name(s) undocumented, 1 stale

Exit code 1. The isolated reproduction also returns 1 with the same stale-option diagnostic.

What was checked

  • The live reader on the pinned main revision gates the additional fields using the captured environment's key/value pairs, rather than a direct getenv call.
  • The existing regression test supplies APS5_TRACE_ALL_PHASES=1 through summary.environment and checks the expanded summary. That test was inspected, not executed for this report.
  • The scanner recognizes direct environment readers and named constants passed to them; the captured key comparison is not recognized. The minimal fixture reproduces the mismatch independently of GPU availability.
  • No change to the rendering or trace runtime is proposed here. A scanner fix should retain the meaning of captured settings rather than substitute the current process environment when formatting an older summary.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6528098650 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/24926). Originally posted by [vgpastor](https://github.com/vgpastor) on 2026-11-21T11:17:50Z. --- ### What happens `python tools/env_reference.py --check` rejects the documented `APS5_TRACE_ALL_PHASES` option as stale, although `TraceFormat::Summary` consumes it from the captured `summary.environment`. Removing the documentation would hide a supported option. ### Title, test or build step The environment-reference consistency check; introduced alongside the captured-environment read in #18243. This is a tooling false positive, not a rendering or title failure. ### AnyPS5 commit Main `133008c0ee976fe44ada669a332edc9c7f088074`. Also observed while validating the unrelated presentation branch `6a385ddd5c06e67600a6e0350bca64f9face9b53`, whose only runtime change is a guard for `APS5_NO_PRESENT_QUEUE`. The trace reader and scanner are identical to main. ### System Windows 11 Pro 10.0.26300. Full check with native Python 3.14.10; isolated reproduction with Python 3.10. GPU/compiler are not used by the reproduction (host GTX 1060 3GB, NVIDIA 581.80). ### Steps to reproduce On the main revision above: ```text python tools/env_reference.py --check ``` The same false positive can be reproduced without scanning the repository: create a source directory containing one `.cpp` with the actual reader expression, ```cpp const bool allPhases = std::any_of(summary.environment.begin(), summary.environment.end(), [](const auto& entry) { return entry.first == "APS5_TRACE_ALL_PHASES" && entry.second == "1"; }); ``` and a reference document containing its table row, then run: ```text python tools/env_reference.py --check --root <source-directory> --doc <reference-document> ``` The one-row document can be: ```text | `APS5_TRACE_ALL_PHASES` | string | `Read.cpp` | | `1` adds every phase total to the trace summary | ``` ### Log ```text error: APS5_TRACE_ALL_PHASES has a row in docs/dev/ENVIRONMENT.md but the code no longer reads it 0 name(s) undocumented, 1 stale ``` Exit code 1. The isolated reproduction also returns 1 with the same stale-option diagnostic. ### What was checked - [The live reader on the pinned main revision](https://github.com/boykopovar/AnyPS5/blob/133008c0ee976fe44ada669a332edc9c7f088074/core/libs/prx/libSceAgcDriver/Execution/include/PerformanceTrace.hpp#L694) gates the additional fields using the captured environment's key/value pairs, rather than a direct `getenv` call. - [The existing regression test](https://github.com/boykopovar/AnyPS5/blob/133008c0ee976fe44ada669a332edc9c7f088074/core/libs/prx/libSceAgcDriver/tests/PerformanceTrace.cpp#L342) supplies `APS5_TRACE_ALL_PHASES=1` through `summary.environment` and checks the expanded summary. That test was inspected, not executed for this report. - The scanner recognizes direct environment readers and named constants passed to them; the captured key comparison is not recognized. The minimal fixture reproduces the mismatch independently of GPU availability. - No change to the rendering or trace runtime is proposed here. A scanner fix should retain the meaning of captured settings rather than substitute the current process environment when formatting an older summary. AI-assisted: yes.
Sign in to join this conversation.
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#24926
No description provided.