feat(tools): optionally validate sampler subtraction windows #12498
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12498"
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 StoneDC on 2026-10-28T15:55:24Z.
What
Adds opt-in
--require-matching-windowwith--since: require module identity records in both captures and nondecreasing cumulative counters before changing--out. Default subtraction remains unchanged. Strict identity lookups use the parser's lowercase keys while diagnostics retain the original frame-module spelling. Module records cannot prove a common process.#13197 merged at 2026-10-31T03:32:43Z; its exact merged head
d5cb07d3c8f92a288e4d171af704a019d15db0b2and recorded mainde824c2919ca65086c6324a1e0388866a7327eeaare ancestors. This PR now has no open prerequisite.Tested
Published head
2c9c09f4aa27df3b80fb2f03ff55c08451931221, based on recorded mainde824c2919ca65086c6324a1e0388866a7327eea. Production script and test file are byte-identical to the previous published head4dfc8f21eb7f7a928f539ecb16fd08f852066d8b. No function, assertion or timeout changed in this integration update.Windows Python 3.12.14/3.14.3 and Linux Python 3.12.16/3.14.4: the actual registered
symbolize_samplesCTest passes, 41 methods per configuration; four existing Windows filesystem/permission skips, zero Linux skips. With the new regression retained, removing only the strict-window/JSON lookup fix still fails its intended assertion on both OSes and interpreters. No setup/import failure is counted.Actual test commit
05d2e4b43d9a61354ee9e10ebc44ed38fa123bcdand published head have identical complete tree15ac7a2035f9f4d43250a88cae25126dfe25f8f6; only the final merge message/parent metadata was normalized afterward. Per-head conventions with the complete description, whitespace, prerequisite/main ancestry and unchanged-file checks pass. Fresh hosted checks remain pending until they finish; no new full product, PS5/title, local macOS or GPU test is claimed.Earlier implementation rationale and validation (historical revisions)
What
Add opt-in --require-matching-window validation before subtracting cumulative sampler captures, retaining permissive behavior by default.
Refresh the prerequisite stack after #13197 was rebased again. Its current description now explicitly states #13197 → #12498 → #12499. Integrate its exact head
df27b15bd6and recorded main, retaining loop-safe path comparisons, both imports on the JSON follower, COFF validation and every original error/feature test. The described order is now aligned across the three PRs; no external branch is edited by this update.Tested
Exact tested head
f073e53274625f8a8ccb83d0c9ea10dc5d8ab688; recorded main9f748f4d8e36ce3714f3b95f3386316e110a9b22; previous published headd9ac1b44ef6de8429c7ba29b7bf43d8e6f0587d6. Recorded main and the previous published head are ancestors. All current-main and previous unique test methods are retained; the documented #12488 context nesting and #12766 identical-shadow cleanup preserve the effective assertions.Windows 11: Python 3.14.3 and 3.12.14, CMake 4.3.1 / MinGW GCC 15.2. Non-root Ubuntu 26.04 / WSL: Python 3.14.4 and isolated Python 3.12.16, CMake 4.2.3 / GCC 15.2. Linux runs exact source archives on its native filesystem; a temporary Git snapshot supplies the release tests' current-tree revision lookup.
For both interpreters on each OS, configure Ninja Release with BUILD_TESTING=ON and ANYPS5_RELINKER_ONLY=ON, then run
ctest --test-dir <build> -R '^symbolize_samples$' -Vand the CTest skip-policy audit. All four configurations pass.Registered
symbolize_samples: 1 CTest group / 37 Python methods pass per configuration. Windows has four existing filesystem/symlink skips; Linux has none. No CTest group skips. Existing real-loop, permissive/strict, JSON where applicable, file-preservation and COFF regressions remain unchanged. The exact live prerequisite is an ancestor; #12499 contains the complete refreshed #12498 headf073e53274625f8a8ccb83d0c9ea10dc5d8ab688.Current-main conventions with this complete description, whitespace, Python 3.9 grammar, AST test-retention and production-script registration checks pass. No timeout was raised. These are interpreter/tool tests, not native product builds. No actual Python 3.9/3.11, local macOS, PS5/title/GPU or live sampler/browser run is claimed. New-head hosted CI starts after publication; old-head approvals/checks are not fresh results for this head.
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-10-28T16:08:35Z.
Review: COMMENTED
I reviewed head
9c03facb2f61and ran the focusedsymbolize_samplesCTest locally on Linux/Python 3.11; it passed (1/1). Conventions and script registration passed. The opt-in validation checks module identity metadata only for referenced modules and verifies nonnegative, nondecreasing counters in stacks, self, inclusive, and total categories before subtraction; default clipping behavior remains unchanged. The CLI regression confirms strict failures occur before replacing the requested output and that default subtraction remains permissive. Hosted Ubuntu/Windows relinker, ASan, conventions, intake, labels, and eligibility passed; the two macOS jobs remain pending. I found no blocker in this scoped review.Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T17:42:37Z.
Review: APPROVED
Reviewed head
9c03facb2f61. This is the first macOS run (macOS 26.2 arm64).Results
python -B -m unittest tools.tests.test_symbolize_samplespasses on Python 3.9.6 (system), 3.13.13 and 3.14.tools/symbolize_samples.pyreverted to main2199ee0d47and the head tests kept, the run fails (RED) on exactly the two new tests: 4 subtest errors (validate_windowmissing) and 1 CLI failure.check_conventions --base upstream/mainpasses.check_test_registration --scriptsfinds 212 scripts.merge-treeonto2199ee0d47is clean.Mutants (14 total)
totaldropped from the category loop,raiseinstead ofparser.error,needs --sinceguard dropped, validation skipped.load()only acceptsisdigitcounts, so it never produces a negative counter, which covers both negative-count checks. An earlier-only stack key with a positive count already fails the decrease check, which covers "collect stack modules from later only".not in later.headersdropped. No test has the later capture missing the record that earlier has.modulesseeded empty (self/inclusive rows ignored). Every fixture's referenced module also appears in a+0xstack frame, so a module referenced only by amodule offset self inclusiverow is never checked.after[key] < countchanged to<=. No test passes validation with an equal counter, so this mutant rejects every unchanged counter and still passes.The test-only diff below kills all three. With it, head passes on all 3 Pythons and main is still RED (4E + 1F).
Merge order: this PR conflicts textually with #12499 (same author) in both files, since both append to
main()and the test class. Whichever lands second needs a rebase. The logic of the two changes is independent.No blocker. The diff is optional hardening.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-29T06:46:28Z.
Review: APPROVED
Reviewed
a1e397ade4d9c225d815cd10721cfe464a5895b0against46e54cf1f73dcabda5573619e55bd99534776a8d. Matching-window validation is opt-in, requires --since, checks recorded module identity and nondecreasing cumulative counters before subtraction, and preserves the default subtraction behavior. No actionable finding in this scoped review.Windows/Python 3.11 validation: head 29 passed, 3 skipped; baseline 27 passed, 3 skipped. The strict-window cases fail or are unsupported on old production and pass on the head. The CLI accurately states that matching records do not prove a common process. Platform alias/permission cases are skipped; no live sampler capture was made.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T22:58:49Z.
Review: COMMENTED
Merge-skew check against current
main:symbolize_samplesfails after a clean merge.Setup: Linux x86_64 (i7-8700, Ubuntu 26.04, Python 3.14.4). Head
f073e53274, merged with--no-ffontomain9605300f29(clean merge, local only). Ranpython3 tools/tests/test_symbolize_samples.pyand the relinker-only CTest suite.Result: 2 failures, 3 of 3 runs. The same test passes on the head alone and on
mainalone.test_strict_window_cli_is_opt_in_and_rejects_before_writing_output:--require-matching-windowexits 2 withlibSceAgcDriver.prx: matching-window validation needs module records in both captures.test_loop_errors_preserve_files_with_matching_window(role='out'): same usage error, sosimulated-loopnever reaches stderr.Cause: #13419 (
98a587adbe, merged as82debeeae0today, after this head).read_headers()now lowercases the# modulenames.validate_window()in this PR still looks them up with the case from the frames (libSceAgcDriver.prx), so every module counts as missing. To confirm: the PR merged onto82debeeae0^1passes, and onto82debeeae0it fails.Fix (verified): look up the lowercased name, as
Symbolizerdoes after #13419. With this change on the merge, the file passes 3 of 3 runs (40 tests). The error message keeps the original name.#13197 alone merges onto the same
mainand passes, so the break starts in this PR. #12499 carries the same code; I left a note there for its JSON lookups.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.