fix(oracle): publish cached executable only after successful build #1542
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1542"
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 ska2704 on 2026-10-08T11:47:01Z.
What
The hardware oracle compiles directly into its shared cached executable. If a compiler writes output and then fails, the next call accepts the fresh partial file and can fail with
Exec format error. An overlapping build can expose the same unfinished output.Compile in a private temporary directory inside the cache, then atomically replace
oracleonly after the compiler succeeds. Failed rebuilds preserve the previous executable and clean unpublished output. Add regression coverage for failed builds, retries, cache reuse and overlapping builds, and register the CPU oracle tests with CTest. This fixes cache publication in the tool introduced by #871.Tested
macOS, Python 3.14, CPU only:
python3 tools/hw-oracle/test_hw_oracle.py: 7 tests passed. The added cases produced 3 assertion failures on unchanged upstream (cold failure, failed rebuild and overlapping build).Exec format errorbefore the fix; after the fix, retry produced a runnable executable and a failed rebuild preserved the old cache.python3 -m unittest discover -s tools/tests -v: passed.BUILD_TESTING=ON; neither was registered with it OFF.git diff --check: passed.The unchanged upstream Build workflow also passed on the fork at this PR's exact head
466ebde2, including the main build, patched-library build and CTest with--repeat until-fail:3:hardware_oracleCTest passed all three repetitions on both platforms.The full product build and ROCm/AMD GPU execution were not run locally; this change does not alter instruction semantics.
After updating the branch with
main(f1451396), commit567b1f92retainsprogress_report,import_auditandhardware_oraclein the relocated Python test block before the relinker-only early return. On macOS with Python 3.14 and AppleClang 21:Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt (no guest exports changed).mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by ska2704 on 2026-10-08T12:33:38Z.
The listed overlaps are mechanical CMake conflicts, with no implementation dependency:
hardware_oracleregistration from this PR needs to be retained inside that relocated block.import_auditimmediately afterprogress_report, at the same insertion point ashardware_oracle. Both test registrations need to be retained.None duplicates the oracle cache fix or is required by it, so
Depends on: noneremains accurate. A test merge of this PR's head466ebde2with currentmain(0b3cc73e) succeeds without conflicts. No source change is needed against currentmain; the resolutions above apply if the overlapping PRs merge first.Imported from boykopovar/AnyPS5. Originally posted by ska2704 on 2026-10-09T02:27:17Z.
Updated with current
mainand resolved the CMake conflict in 567b1f92. All three Python tests (progress_report,import_audit,hardware_oracle) are retained before the relinker-only early return.On macOS, the relinker-only configuration and test-registration check passed, and each Python CTest passed three repetitions. The oracle suite's 7 tests, tools suite's 14 tests and conventions checks also passed. The PR is mergeable again; upstream CI for the updated revision is awaiting workflow approval.