Repository navigation
perf(apple): reuse the process identity for native-build cache locks - #5203
Conversation
Every fold and bridge cache acquisition read this process's start time from the process table. Take the lock owner from readCurrentOwnerIdentity(), which remembers the first readable answer and retries an unreadable one. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
a5af792 is ready, with no code problems found. Not blocking: take or leave a follow-up issue so that every lock owner for the current process gets its identity from The Windows test thread no longer applies and can be resolved, because both tests in All 21 checks pass at this head. Not verified here: the new tests and their failure on the base were assessed by reading the code, without a local run, and the read counts and the saved process spawn were not measured on a live macOS daemon. The local validation in the PR description names fd5c42c, and the head adds only the Windows skip in the test file. Nothing else from this review needs to happen before merge. |
…roc-first Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * origin/main: perf(apple): reuse the process identity for native-build cache locks (#5203) perf(apple): read the native-build toolchain identity with two concurrent probes (#5206) perf(macos): reuse the helper fingerprint between unchanged calls (#5207) docs(agents): add performance guidance (#5208) perf(daemon): classify a device claim owner only for refusals and settlement (#5210)
Summary
Fold and bridge cache acquisitions lock before testing for a cached binary, so even a hit builds a lock owner record. Each one looked up this process's start time in the process table.
The record now takes PID and start time from
readCurrentOwnerIdentity(), the host-kit owner of that identity. It keeps the first readable answer for the life of the process and asks again after an unreadable one. Cache keys, cache verification and foreign-owner checks are unchanged.Own start-time reads, counted by the new test (
/prochidden, so every read goes through the process table):On Linux outside the test, the read comes from
/proc, so the saved process spawn applies to macOS hosts.Validation
Tested at fd5c42c on macOS:
vitest run --project unit-coreonnative-build/host-lock.test.tsandnative-build/cache.test.ts: 5 passed.host.ts, both new tests fail on the read count.oxfmtandoxlinton the changed files: clean.Typecheck, layering, coverage and the full unit suite are CI obligations. No device run: lock record contents are unchanged. Self-review was a re-read of the diff; no independent reviewer ran.
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.