From 2de9a58922f2af5350fa24cf7973f355601f99aa Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Sun, 3 May 2026 09:27:36 +0200 Subject: [PATCH] =?UTF-8?q?sp7(wire):=20T7=20polish=20=E2=80=94=20fix=202?= =?UTF-8?q?=20stale=20docstrings=20around=20compute=5Fadaptive=5Fbudgets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two clarity-only edits surfaced by code review: - M1: compute_adaptive_budgets header docstring claimed floors of "0.05 C51, 0.05 IQN, 0.02 CQL, 0.02 Ens" — stale post-T7 (IQN is now 0.11, others are sentinel-aware bootstrap). Rewritten to reflect the SP7 contract: IQN keeps BASE_IQN=0.11 structural floor; C51/CQL/ENS use sentinel-aware bootstrap. - M2: last_ens_budget_eff docstring misattributed ENS to "SP5 Pearl 2 (flatness-modulated)" — Pearl 2 stopped writing BUDGET_ENS_BASE in T6. Rewritten to state ENS has no active controller driver in SP7; bootstrap-only. Comment-only — zero runtime effect. cargo check clean. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/ml/src/trainers/dqn/fused_training.rs | 15 +++++++++------ docs/dqn-wire-up-audit.md | 3 +++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/ml/src/trainers/dqn/fused_training.rs b/crates/ml/src/trainers/dqn/fused_training.rs index 87cbdcf16..bce6d42c9 100644 --- a/crates/ml/src/trainers/dqn/fused_training.rs +++ b/crates/ml/src/trainers/dqn/fused_training.rs @@ -3370,9 +3370,10 @@ impl FusedTrainingCtx { /// budgets) feed the full-buf trunk/value scaling call — preserving SP5 Layer B /// behaviour for shared parameters (D3 decision in SP6 spec). /// - /// Cold-start floor: ISV slots read 0 before first observation. Floors (0.05 C51, - /// 0.05 IQN, 0.02 CQL, 0.02 Ens) are Invariant 1 carve-outs (numerical-stability, - /// not tuned constants). + /// Cold-start bootstrap: ISV slots read 0 (sentinel) before first observation. + /// IQN keeps a structural BASE_IQN=0.11 floor (reference budget, Invariant 1 + /// carve-out). C51/CQL/ENS use sentinel-aware bootstrap: 0.05/0.02/0.02 + /// on cold start, controller value verbatim otherwise (SP7 Task 7). pub(crate) fn compute_adaptive_budgets( &mut self, ) -> ([f32; 4], [f32; 4], [f32; 4], [f32; 4], f32, f32, f32, f32) { @@ -3446,9 +3447,11 @@ impl FusedTrainingCtx { /// docstring claimed a "1−iqn−cql−ens" formula that was never /// implemented; per `feedback_trust_code_not_docs`, code wins over docs. pub(crate) fn last_c51_budget_eff(&self) -> f32 { self.trainer.last_c51_budget_eff } - /// SP5 Pearl 2 (flatness-modulated): last per-step ensemble budget (mean - /// of 4 per-branch values). Bootstrap floor ENS_BOOTSTRAP_BUDGET=0.02 - /// applied sentinel-aware in `compute_adaptive_budgets`. + /// SP7 (2026-05-03): last per-step ensemble budget (mean of 4 per-branch + /// values). ENS has no active controller driver in SP7 (Pearl 2 no longer + /// writes BUDGET_ENS_BASE; loss-balance controller covers CQL/C51 only). + /// Sentinel-aware bootstrap ENS_BOOTSTRAP_BUDGET=0.02 applied in + /// `compute_adaptive_budgets` on cold start / fold boundary. pub(crate) fn last_ens_budget_eff(&self) -> f32 { self.trainer.last_ens_budget_eff } /// F3: Spectral gap — sigma_1 / sigma_2 via rolling Gram + power iteration. diff --git a/docs/dqn-wire-up-audit.md b/docs/dqn-wire-up-audit.md index 211815a42..9b79e7f65 100644 --- a/docs/dqn-wire-up-audit.md +++ b/docs/dqn-wire-up-audit.md @@ -3921,4 +3921,7 @@ extended. No producer kernel yet — that arrives in the next commit. on last_cql_budget_eff, last_c51_budget_eff, last_iqn_budget_eff, and last_ens_budget_eff replaced with accurate SP7/SP5 owner references. Layer A complete: producer + consumer + observability all wired and consistent. + T7 polish landed (commit ⟨pending⟩) — 2 stale docstrings around + compute_adaptive_budgets (header floors + last_ens_budget_eff Pearl-2 + attribution) corrected to reflect the SP7 sentinel-aware bootstrap contract. - T9–T10: smoke + 50-epoch verification.