fix(hw-oracle): reject duplicate JSON report fields #12816
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12816"
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 malekaifa on 2026-10-29T11:07:13Z.
What
compare_results.pycurrently lets Python's JSON decoder silently keep the last value when an object repeats a field name. That can make an ambiguous or corrupted capture look valid and can hide a changed setting, input, or output value.Reject duplicate JSON object fields during decoding instead. The same rule applies at every object level, including the top-level report,
floating_point_modes, and individual row objects.Tested
1db077e876a839f75d11a56e728e7f56a4a8c25e: all three new duplicate-field cases are accepted and return 0 before the fix.tools/hw-oracle/test_compare_results.py— 13 tests OK.tools/hw-oracle/test_compare_results.py— 13 tests OK.tools/hw-oracle/test_compare_results.py— 13 tests OK on the validated candidate; the final branch transplant changes only the parent commit and preserves the same two file blobs.tools/hw-oracle/test_hw_oracle.py— 48 tests OK, 4 skipped.tools/check_conventions.py --base origin/main— passed on the candidate.git diff --checkandpy_compile— clean.compare_results.py.Final fork head:
e8815286019f328c37f3ce23cf7422e813eeb48a, parent59d7cff571bd01d3b5055e2e36734646f59f0061.Checklist
main; no other open PR implements the same behavior.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-29T11:11:37Z.
Review: COMMENTED
🟢 Approval recommended
No active review issues remain for the change that rejects duplicate JSON fields.
No open issues 🎉
What changed in this PR
This PR hardens the hardware-oracle report comparator by rejecting duplicate JSON fields instead of silently keeping the last value, preventing ambiguous captures from appearing valid.
Changes:
tools/hw-oracle/test_compare_results.pytools/hw-oracle/compare_results.pyReview effort: Balanced
Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-29T11:45:48Z.
Review: APPROVED
Verified on macOS arm64 at
e881528601(mainba5b5330b3; merge-tree clean,git diff --checkclean,check_conventions --base upstream/mainpasses,pr_overlapchecked 1401 PRs with no overlap).test_compare_resultspasses 13/13 on Python 3.9.6, 3.13 and 3.15.test_hw_oracleis OK (3 platform skips) on all three.compare_results.pyand the PR's test, all three subtests (rows,ieee,output) fail. Each one returns 0.error:and no traceback:"\u0072ows"next to"rows"): the hook sees the decoded name, so this is caughtcompare_results.pyis the onlyjson.loadsof report input intools/hw-oracle. The others are in tests and read the tool's own output.LGTM.
Pull request closed