Skip to content

Add cheap runtime optimisation through S27 - #7

Merged
Valessc2 merged 1 commit into
mainfrom
agent/runtime-s25-s27
Aug 18, 2026
Merged

Valessc2 merged 1 commit into
mainfrom
agent/runtime-s25-s27

Conversation

@Valessc2

Copy link
Copy Markdown
Owner

Scope

Completes S25-S27 on top of the merged S20-S24 Tuner without adding a fourth runtime pillar.

S25 — profiling / telemetry

  • fixed-storage 65-bucket log2 latency histogram
  • allocation-free observation with saturating counters
  • p50/p95/p99 conservative bucket upper bounds
  • compile-time-disabled scoped timer with no clock read or histogram mutation

S26 — compute-budget governor

  • generic Normal/Soft/Hard latency pressure state
  • hysteresis using previous completed duration
  • consumer-owned Critical/Important/Optional work classification
  • invalid threshold ordering fails closed to Hard
  • default 22/28/38 ms seed values generalised from MMEvo Z7, without importing MME policy

S27 — auto-calibration

  • caller-owned workload points and evidence
  • requires baseline evidence at each point
  • delegates winner selection to the single S20 ChooseNetBenefitChampion authority
  • compresses adjacent winners into tiny crossover bands
  • explicit measured control-overhead gate so the optimiser can reject its own bookkeeping if too expensive

VC hardening found during the slice

The existing S20 net-benefit policy accepted non-finite policy thresholds implicitly. This PR makes invalid/NaN policy values fail closed to baseline with an explicit PolicyInvalid reason.

Cheapness

  • C++20/STL only; no new dependency
  • no runtime allocation in histogram observation, governor updates or crossover lookup
  • no benchmarking/search in hot kernels
  • compile-time instrumentation-off path has no timer state/clock read
  • auto-calibration is control-plane; its output is a compact candidate-ID table
  • baseline/OFF remains valid for every workload range

Validation

The exact new telemetry/governor/calibration code was compiled locally with GCC 14.2 under -Wall -Wextra -Wpedantic -Werror; the runtime optimisation tests passed. Full repository Linux/Windows core + Python-adapter CI on this PR is the cross-platform gate.

Not claimed

No target-hardware crossover values, runtime speedup, bot integration or V1 certification is claimed. S28-S32 remain the proof/output/hardening programme.

Complete S25-S27 with fixed-storage telemetry, compile-time-disabled timing, a fail-closed latency hysteresis governor, single-authority crossover calibration and an explicit control-overhead cheapness gate.
@Valessc2
Valessc2 marked this pull request as ready for review August 18, 2026 23:10
@Valessc2
Valessc2 merged commit 666b48c into main Aug 18, 2026
4 checks passed
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