fix(tools): exclude parameter returns from empty progress classifications #14424
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14424"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by SHOnnay on 2026-11-01T12:25:52Z.
What
The progress scanner classified parameter returns such as
WTF::fastMallocGoodSize(size) { return size; }as constant-return, behaviourally empty exports.Pass parameter context through the inert-classification helpers and their direct callers so parameter returns are not treated as constants, while preserving the existing named-constant and empty-wrapper handling. The scanner remains heuristic; this does not implement full C++ constant resolution.
There is a one-line context overlap with #13801 at the
inert_bodycall inscan_library; I will rebase if #13801 merges first.Tested
macOS only: Apple M1, macOS 27.0.1 (26A434), Python 3.15.2. Baseline:
ba627802e2.python3 tools/tests/test_progress.py: with the same expanded tests, the original implementation ran 63 tests with 10 failures (including subtests); after the fix all 63 tests pass.pytestis not installed, so the existing unittest runner was used.python3 tools/check_conventions.py --base upstream/main: all conventions checks passed.python3 tools/progress.py --jsonon the same source tree before and after: library exports remain 8,998 implemented / 34,292 declared (26.24%); shader counts remain 1,166 / 1,166 (100%). All export name lists and other labels are identical. The only corrected label is_ZN3WTF18fastMallocGoodSizeEm, removed frominert_names.python3 tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch codex/fix-progress-constant-returns: exit 2, failed closed because #13801 conflicts with main. Manually compared its unchanged head22b41618e2; the known one-line context overlap is noted above, and the separate test block does not overlap its test hunks.Linux and Windows were not run locally. No GPU or game was tested.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T12:29:06Z.
Review: COMMENTED
Reviewed — no blocking findings
The change stops treating a returned parameter as a constant, the new tests fail on base as intended, and the hosted checks for this head are still queued.
What I ran
Head
4e6728f8bcc512fd7eb7b79c07b518e0abd8c748, baseba627802e2210187d417deb64c8f2fed8e33011f(the base the precheck used). Environment: Linux 6.1.0-54-amd64 (Debian 12), Python 3.11.2, git 2.39.5. No build or compile was run; the change is Python-only.The precheck's test-quality helper was not present in the PR head tree, so I ran
tools/pr_test_quality.pyby hand against the extracted head files.Results
git diff --check(precheck)tools/check_conventions.py(precheck)py_compile tools/progress.py(precheck)python3 -m unittest tools.tests.test_progressat4e6728f8bc(precheck, Python 3.11.2)ba627802e2(precheck negative control)pr_test_quality.pyby hand4e6728f8bcwhen checkedUnedited output: head unit run (precheck stderr)
Unedited output: negative control on base (precheck, final lines; the tracebacks above them are in the precheck report)
Negative control
return <parameter>;is not behaviourally empty (6 names)tools/progress.pytools/progress.pytools/progress.pytools/progress.pyFindings
Blocking: none.
Non-blocking:
CONST_RETURNaccepts any\w+(line 35), andinert_statementrejects only names inparameters(lines 154 to 157). A body such asint APS5_VABI Get() { return gState; }, wheregStateis a non-constexprfile-scope variable, is still counted as inert. This is the same kind of false positive the PR fixes for parameters. I read this from the source at4e6728f8bc; I did not run it. The PR body's "heuristic" sentence covers it in general. The smallest useful change is to name this case in the PR body so the remaining limit is explicit.Sources
tools/progress.py,CONST_RETURN, line 35, at 4e6728f8bctools/progress.py,inert_statement, lines 154 to 157, at 4e6728f8bctools/tests/test_progress.py,ProgressConstantReturnTests, lines 872 to 932, at 4e6728f8bcNot verified
tools/progress.py --jsoncomparison (8,998 implemented and 34,292 declared exports, identical name lists) was not reproduced. I did not runprogress.pyfrom the PR head.pr_overlap.pyfailed closed on the #13801 conflict. The author's manual comparison at head22b41618e2was not re-run.To get this to a good state
The hosted conventions and the Progress report job need to pass at
4e6728f8bcbefore approval. The non-blocking point is optional for merge.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T12:43:20Z.
Review: COMMENTED
Reviewed — no blocking findings
The progress scanner no longer counts a parameter returned as a constant stub, and the new unit tests pin the constant, default-argument, pointer and multi-statement cases; I found no blocking issue at
4e6728f8bc.What I ran
Exact head
4e6728f8bcc512fd7eb7b79c07b518e0abd8c748; PR baseba627802e2210187d417deb64c8f2fed8e33011f(currentmain). I read the diff oftools/progress.pyandtools/tests/test_progress.py, and ran the repository's convention checker frommainagainst this head:Results
All conventions checks passed.)Findings
Blocking: none.
Non-blocking:
CONST_RETURNaccepts any bare identifier (return \w+;), and the change excludes only the function's own parameters from that rule. Areturnof a non-parameter identifier, such as a global or static variable, is therefore still counted as a constant stub. That behaviour was already present before this PR and is not a regression, but it is the same class of error the PR fixes for parameters, so the same check could cover it.Not verified
To get this to a good state
No change is needed for this review. Optional: extend the parameter exclusion to non-parameter identifiers that name variables.