Skip to content

fix: bound backup scan memory and deferred AUTH work - #127

Merged
EhsanAzish80 merged 15 commits into
mainfrom
fix/runtime-diagnostics-5111
Nov 22, 2026
Merged

EhsanAzish80 merged 15 commits into
mainfrom
fix/runtime-diagnostics-5111

Conversation

@EhsanAzish80

@EhsanAzish80 EhsanAzish80 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Problem and resulting behavior

Backup-heavy workloads exposed repeated credential-attribution trust work, expensive creation-history maintenance on the ES callback thread, and Foundation read allocations retained across long streaming scans. Deferred AUTH workers could also reserve the reply before completing policy work, excluding the watchdog before a response was submitted.

This PR:

  • Coalesces credential observations before expensive identity work and bounds attribution work.
  • Uses heap/path-index creation tracking while preserving create-before-rename ordering.
  • Releases streaming-hash read allocations per chunk, with hash-equivalence tests.
  • Moves deferred AUTH ownership to the response boundary and schedules watchdogs independently of worker work.
  • Allows one bounded same-verdict retry for an internal response communication failure; terminal errors are not retried and concurrent submissions are prohibited.
  • Adds bounded pending-AUTH, scan, mount-startup, slow-response and callback diagnostics.
  • Includes the private-build-only synthetic worker-delay hook, corrected signing-flag admission and regression tests used to verify installed watchdog integration.

Existing allow/deny rules, Strict Mode, trust/revocation/expiry policy, ES cache flags and timeout fallback decisions are unchanged. No broad backup-app exclusion or scan-policy reduction is added. Synthetic delays require the private compile flag, exact signed helper/build/cdhash/path, root-owned expiring configuration and bounded admission; normal release builds do not enable them.

Verification

  • Full suite launched in Xcode: 1,091 passed, zero failures/skips; 13 main-thread runtime warnings remain recorded.
  • Private 5118 built from 89fabca2cb4ccbdba61e9084015544b0d60042da; app and both active extensions verified at 5118. Signing, notarization, stapling, Gatekeeper and matching arm64/x86_64 dSYMs verified.
  • Installed synthetic control injected no delay. Credential and prelaunch cases each admitted/completed one three-second delay and recorded one watchdog win, with no response errors, late attempts or pending AUTHs. Peak/final footprint 62.9 / 48.7 MiB. Settings unchanged; control removed.
  • Final bounded SMB scan completed 737 entries / 552 files in 277.02 s. Across 691 passive samples, peak/final footprint was 100.8 / 94.0 MiB. Memory stayed bounded but did not return to the starting footprint.
  • Final SMB capture retained the same process/settings, with zero new termination reports, response errors, late attempts, pending AUTHs, duplicates or diagnostic-capacity overflows at the end.
  • Both callback histories and slow-response history preserved; no new threshold-qualified records or sequence mismatches. The shell-profile client delivered no callbacks; its empty history is not coverage.
  • Test mount/server/relay stopped normally; retained fixture and evidence copied/hash-verified. No profiler attachment, suspension, settings change or synthetic delay during SMB.
  • Response-race, stalled-worker, cancellation, same-verdict recovery, bounded admission and signing-flag regression tests included.
  • Repository metadata, release-payload audit tests, replay manifests/scorecard validation and git diff --check pass.
  • Fresh CI on current head b864a9003dc75c3da92a5e580dd9cb0dd0a87f5f: build-and-test, both Sonar checks and Codecov patch all pass. GitHub reports CLEAN / MERGEABLE; the previous head's results are not substituted.

Whole-extension CPU averaged 40.4% / 26.4% / 51.0% across baseline / scan-plus-recovery / final baseline. The active scan itself averaged 33.6%. Cloud activity was present throughout; these numbers do not establish causal CPU improvement or reader-thread CPU. Passive thread enumeration recorded 691 samples without API errors, but its identifiers did not match callback identifiers: reader-thread CPU remains unavailable, not zero or a demonstrated pass.

See 5118 validation closeout, 5116 installed results, AUTH ownership design and private 5118 diagnostic safeguards. Exact source, signed packages, matching dSYMs and checksummed raw evidence are retained locally; private download links and raw reporter diagnostics are excluded.

Scope and remaining limits

The local validation cycle is complete; no additional test cycle is planned for this PR. The fixture is synthetic loopback SMB, not the reporter's full remote Time Machine/Backblaze workload. Worker sleep proves installed watchdog integration under the tested delay, not historical kill causality or an absolute deadline guarantee. An in-flight ES response API cannot safely be preempted.

Historical kernel-kill causality, full reporter-workload resolution, reader-thread CPU attribution, long-duration write budget and diagnostic-counter semantics remain documented follow-ups. The reporter's 19 h 58 m 5111 window had serious memory growth; it is not a pass for 5111 or evidence about later builds.

Related to #122; does not close it. Ready to merge after maintainer approval: current-head checks pass and GitHub reports no conflicts. Left open and unmerged as requested; no public package, appcast or website change.

@EhsanAzish80 EhsanAzish80 changed the title fix: preserve private 5111 diagnostics and measured performance fixes fix: bound credential attribution and creation tracking; add 5111 diagnostics Nov 19, 2026
@EhsanAzish80 EhsanAzish80 changed the title fix: bound credential attribution and creation tracking; add 5111 diagnostics fix: bound scanner allocations and deferred AUTH ownership; validate private 5116 Nov 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

@EhsanAzish80 EhsanAzish80 changed the title fix: bound scanner allocations and deferred AUTH ownership; validate private 5116 fix: bound backup scan memory and deferred AUTH work Nov 22, 2026
@EhsanAzish80
EhsanAzish80 merged commit f7ee6b3 into main Nov 22, 2026
4 checks passed
@EhsanAzish80
EhsanAzish80 deleted the fix/runtime-diagnostics-5111 branch November 23, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request security Security hardening without confidential vulnerability details

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants