docs(hw-oracle): build the oracle under XDG_CACHE_HOME when it is set #12719
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12719"
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 XairRrR on 2026-10-29T04:53:51Z.
What
docs/dev/HW_ORACLE.mdsays the first run buildsoracle.cinto~/.cache/anyps5-hw-oracle/. That is wrong wheneverXDG_CACHE_HOMEis set.tools/hw-oracle/hw_oracle.pyusesHW_ORACLE_CACHEif it is set. Otherwise it uses$XDG_CACHE_HOME/anyps5-hw-oracle, and falls back to~/.cache/anyps5-hw-oracleonly whenXDG_CACHE_HOMEis unset or empty. For example, withXDG_CACHE_HOME=/tmp/xdgthe binary is built under/tmp/xdg/anyps5-hw-oracle/, and a reader who looks in~/.cacheto find or clear the build finds nothing. The document now namesXDG_CACHE_HOME, the~/.cachefallback, andHW_ORACLE_CACHEas the override of both. Only the document changes.Tested
Arch Linux 7.2.11-zen, GCC 16.2.1, Ninja, Release, Intel Core i9-14900KF. Documentation only, so no build was needed.
hw_oracle.CACHEunder four environments.XDG_CACHE_HOME=/tmp/xdggives/tmp/xdg/anyps5-hw-oracle.XDG_CACHE_HOMEunset or empty withHOME=/tmp/hgives/tmp/h/.cache/anyps5-hw-oracle.HW_ORACLE_CACHE=/tmp/owithXDG_CACHE_HOME=/tmp/xdggives/tmp/o.python3 tools/hw-oracle/test_hw_oracle.py: 48 tests, OK (1 skipped).python3 tools/check_conventions.py --base origin/main: all conventions checks passed.git diff --check origin/main: clean.python3 tools/pr_overlap.py --branch auto/docs-hw-oracle-xdg-cache: no overlap with open pull requests. #11454 and #12348 also edit this file, in other paragraphs, and both merge cleanly with this branch.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 rooklz on 2026-10-29T05:21:44Z.
Review: APPROVED
Checked on macOS 26 arm64 at
664a5c93e8, against main52c09d567d.The new sentence matches the code.
tools/hw-oracle/hw_oracle.pyL17 on main isCACHE = Path(HW_ORACLE_CACHE or Path(XDG_CACHE_HOME or ~/.cache) / "anyps5-hw-oracle"), andbuild()(L68) is the only reader. Because it usesor, an empty variable counts as unset, which is what "unset or empty" says. I printedhw_oracle.CACHEfrom agit archiveof the PR head withHOME=/tmp/hand both variables cleared first. Python 3.9.6, 3.13 and 3.14 gave the same result for all 7 environments:XDG_CACHE_HOME=XDG_CACHE_HOME=/tmp/xdgHW_ORACLE_CACHE=/tmp/o XDG_CACHE_HOME=/tmp/xdgHW_ORACLE_CACHE= XDG_CACHE_HOME=/tmp/xdgHW_ORACLE_CACHE= XDG_CACHE_HOME=XDG_CACHE_HOME=relAn empty
HW_ORACLE_CACHEalso falls through instead of overriding, so "overrides both" holds only for a non-empty value. That is the usual reading, so I don't think it needs a word.oracle_hip.pynever readsCACHE, so the paragraph is right to stay under### Linux.Optional, and not this PR: a relative
XDG_CACHE_HOME(rowrel) is used as-is, relative to the cwd. The XDG spec says relative values should be ignored. That would be a code change in a separate PR, if anyone wants it.Gates:
test_hw_oracle.pypasses on Python 3.13 (OK, 3 skipped, no GPU).check_conventions.py --base upstream/main --headpasses,git diff --checkis clean, andmerge-treeagainst main is clean.pr_overlap.py --branchreports "No overlap with open pull requests."Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-29T07:08:07Z.
Review: APPROVED
Reviewed
664a5c93e8e9288e4ffacdf1495c6f4f6aa16fa5against52c09d567d2fa453494dd720fcf53a98149468e4. The pinned oracle runner selects HW_ORACLE_CACHE first, then nonempty XDG_CACHE_HOME/anyps5-hw-oracle, then ~/.cache/anyps5-hw-oracle. The revised fallback and override wording matches that expression. No actionable finding in the documentation change.Validation: inspected the changed wording and relevant pinned source; relative source links and git diff --check pass. Documentation-only validation: no runtime behavior changed. Author-reported title inventories, console/emulator observations and macOS/physical-GPU measurements were not independently reproduced; this review does not certify those measurements.