Skip to content

RUE-1223: make compiler timing contention-free - #2106

Merged
steveklabnik merged 1 commit into
trunkfrom
codex/rue-1223-contention-free-instrumentation
Aug 5, 2026
Merged

RUE-1223: make compiler timing contention-free#2106
steveklabnik merged 1 commit into
trunkfrom
codex/rue-1223-contention-free-instrumentation

Conversation

@steveklabnik

Copy link
Copy Markdown
Collaborator

Summary

  • replace the compiler timing collector's per-transition shared lock with thread-local accumulation and bounded publication
  • preserve exact nanosecond phase accounting with independent root-union and phase-band reducers
  • add compiler-owned body-closure, CFG/optimization, and backend boundaries without teaching the generic query runtime about compiler phases
  • cover real registered-batch publication, cancellation, deterministic merge, corruption detection, and phase attribution
  • document the collector contract and the complete local performance ledger

Why

Timing collection ran on parallel query hot paths and serialized every span close and phase transition through one shared mutex. This change keeps the hot path local and merges once at worker completion or report generation, so instrumentation can coexist with compiler parallelism.

Performance

Alternating release-build pairs on an Apple M5 measured median paired instrumentation overhead of:

  • Meridian: +1.65% (5 pairs)
  • Caldera: +0.87% (11 pairs)

The ratio of Caldera's unpaired marginal medians was +2.64% on the noisy interactive host; raw samples and the pairing rationale are preserved in the acceptance ledger. Startup medians were both 0.01 s at the host timer's resolution.

Unattributed compiler-root time fell from 39.0% to 12.0% on Meridian and from 53.1% to 22.3% on Caldera. Instrumented and uninstrumented output hashes matched for both workloads, and the phase partition balanced exactly in integer nanoseconds.

Validation

  • scripts/rue fmt
  • scripts/rue quick (30/30 targets)
  • /opt/homebrew/bin/bash clippy.sh (63 targets)
  • RUE_TEST_TIER=premerge ./test.sh (78/78 targets)
  • release Meridian and Caldera output-parity and exact-accounting smokes
  • independent high-effort adversarial review: no remaining blockers

Fixes RUE-1223.

@steveklabnik
steveklabnik enabled auto-merge August 5, 2026 05:39
@steveklabnik
steveklabnik force-pushed the codex/rue-1223-contention-free-instrumentation branch from 5b593ff to 3b6ba59 Compare August 5, 2026 05:50
@steveklabnik
steveklabnik added this pull request to the merge queue Aug 5, 2026
Merged via the queue into trunk with commit 7eb447d Aug 5, 2026
22 checks passed
@steveklabnik
steveklabnik deleted the codex/rue-1223-contention-free-instrumentation branch August 5, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant