From eb398ad0c085bc1bd4dd6847b6886b4e3a45e47f Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Fri, 20 Nov 2026 23:01:54 +0800 Subject: [PATCH 1/2] RHT-26: bridge empirical dose math to signed FSI-01 resolution planning --- .github/workflows/rht26-empirical-bridge.yml | 42 +++++ docs/rht26_empirical_math_review.md | 94 ++++++++++++ .../scripts/preflight.py | 27 +++- .../scripts/test_preflight_resolution.py | 39 +++++ .../evaluation_reward_carryover_bridge.py | 145 ++++++++++++++++++ ...test_evaluation_reward_carryover_bridge.py | 71 +++++++++ 6 files changed, 417 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/rht26-empirical-bridge.yml create mode 100644 docs/rht26_empirical_math_review.md create mode 100644 src/spiral_ln/evaluation_reward_carryover_bridge.py create mode 100644 tests/test_evaluation_reward_carryover_bridge.py diff --git a/.github/workflows/rht26-empirical-bridge.yml b/.github/workflows/rht26-empirical-bridge.yml new file mode 100644 index 00000000..159b66c3 --- /dev/null +++ b/.github/workflows/rht26-empirical-bridge.yml @@ -0,0 +1,42 @@ +name: RHT-26 empirical math bridge (CPU) +on: + push: + paths: + - 'src/spiral_ln/evaluation_reward_carryover_bridge.py' + - 'tests/test_evaluation_reward_carryover_bridge.py' + - 'docs/rht26_empirical_math_review.md' + - 'skills/evalmath-mechinterp-power/scripts/preflight.py' + - 'skills/evalmath-mechinterp-power/scripts/test_preflight_resolution.py' + - '.github/workflows/rht26-empirical-bridge.yml' + pull_request: + paths: + - 'src/spiral_ln/evaluation_reward_carryover_bridge.py' + - 'tests/test_evaluation_reward_carryover_bridge.py' + - 'docs/rht26_empirical_math_review.md' + - 'skills/evalmath-mechinterp-power/scripts/preflight.py' + - 'skills/evalmath-mechinterp-power/scripts/test_preflight_resolution.py' + - '.github/workflows/rht26-empirical-bridge.yml' + workflow_dispatch: +permissions: + contents: read +jobs: + cpu-math: + runs-on: ubuntu-latest + timeout-minutes: 7 + env: + PYTHONPATH: src + PYTHONDONTWRITEBYTECODE: '1' + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Compile pure-stdlib model and preflight + run: | + python -m compileall -q src/spiral_ln/evaluation_reward_carryover_bridge.py skills/evalmath-mechinterp-power/scripts/preflight.py tests/test_evaluation_reward_carryover_bridge.py + - name: Exact empirical bridge tests + run: python -m unittest discover -s tests -p 'test_evaluation_reward_carryover_bridge.py' -v + - name: Generic mechanistic-resolution and signed-FSI regressions + run: python -m unittest discover -s skills/evalmath-mechinterp-power/scripts -p 'test_*.py' -v diff --git a/docs/rht26_empirical_math_review.md b/docs/rht26_empirical_math_review.md new file mode 100644 index 00000000..d188de57 --- /dev/null +++ b/docs/rht26_empirical_math_review.md @@ -0,0 +1,94 @@ +# RHT-26 empirical mathematical review (CPU-only) + +**20 November 2026. Evidence:** eight-root Qwen3-1.7B *development* pilot in [Control-Harness commit 27b210f](https://github.com/MoralityLabAI/Control-Harness/commit/27b210f758dbf45540dbc0e5226cb00e84dc623b), audited at [Control-Harness PR #85](https://github.com/MoralityLabAI/Control-Harness/pull/85). The finite theorem/receipt in EvalMath remains exact synthetic evidence. Confirmation roots opened: **zero**. + +This addendum creates a separate mathematical bridge without revising the original RHT-26 source-bound receipt. The published empirical case-level data live in Control-Harness. Our compact exact-count fixture is a snapshot for arithmetic tests, not an independent GPU replication. + +## 1. Expand the artifact state to model visible cue density + +RHT-26's four-state variable (a, l) uses a binary accessible-artifact bit a and a binary declared policy bit l. It establishes reset closure, update-order effects, exact joint endpoints and contraction under those hypotheses. + +The pilot's measured **artifact-only** joint persistence was: + +| Visible source episodes | 0 | 1 | 2 | 4 | 8 | +|---|---:|---:|---:|---:|---:| +| Frozen weights, p10, cases persisting / 256 | 0 | 15 | 161 | 247 | 242 | +| Learned weights plus artifacts, p11 | 0 | 1 | 94 | 186 | 44 | + +The binary artifact bit conflates one cue and eight repeated cues. A more faithful model should track (m, o, l), where m counts cue-bearing entries currently readable, o counts distinct provenance origins, and l denotes a policy state or its full checkpoint. A history-dependent or retrieval-position kernel may also be needed. + +A simple independent-write threshold model gives + +\[ +P(M_T\geq k)=\sum_{j=k}^{T}{T\choose j}q^j(1-q)^{T-j}. +\] + +For fixed q and k, this is monotone in T. The exact implementation in evaluation_reward_carryover_bridge.py checks the family without fitting it to the observed model. The five-case pooled decline in p10 between doses four and eight is a potential discriminator of such a model, subject to paired-root uncertainty and context-position effects. + +## 2. The end-state is sufficient under the current measurement interface + +For a Markov-sufficient model whose terminal scoring kernel depends on S_T, + +\[ +H_{1:T}\longrightarrow S_T\longrightarrow (B,A). +\] + +Histories inducing identical terminal state laws have identical endpoint laws under the same kernel. A frozen language model with identical serialized final workspace, weights, decoding configuration and evaluator should likewise have the same output distribution unless an additional state channel exists. + +Control-Harness found that deleting the cue store reduced joint persistence to 0/256 and transplanting it into the clean checkpoint reproduced the full 242/256 artifact-only result root by root. A single cue embedded in 3,117 matched workspace tokens, with 31 other neutral entries, yielded 0/256. These interventions support a **current-workspace cue-density** mechanism in the tested interface. They do not isolate the causal contribution of elapsed episode history, because the final visible text differs between one and eight cues. + +A future history-swap test should hold the exact serialized final workspace fixed while changing which earlier episodes constructed it, then test the zero-difference prediction. To study endogenous stigmergy, let the actor write its own records and compare against host-written, matched traces. + +## 3. Negative learned-weight interaction: joint risk and selected denominators + +Dose-eight joint (B,A) counts in order (00, 01, 10, 11), each over 256 target cases: + +| Arm | 00 | 01 | 10 | 11 | +|---|---:|---:|---:|---:| +| p00 (cleared, frozen) | 256 | 0 | 0 | 0 | +| p10 (retained, frozen) | 0 | 0 | 14 | 242 | +| p01 (cleared, LoRA) | 256 | 0 | 0 | 0 | +| p11 (retained, LoRA) | 38 | 0 | 174 | 44 | + +The additive interaction equals -99/128. Since p00=p01=0, this also equals the controlled learned-weight contrast **when artifacts remain accessible**, p11-p10. + +Let b=P(B=1), r=P(A=1 | B=1) and p=br. Then + +\[ +p_{11}-p_{10} +=(b_{11}-b_{10})r_{10}+b_{11}(r_{11}-r_{10}) +=-2299/16384-10373/16384=-99/128. +\] + +The first term (-0.14032) tracks changes in the pre-correction failure population. The second (-0.63312) tracks the selected-group persistence contrast. Both are descriptive and **neither is an identified natural mediation effect**. Model updates were observed, but whether the negative interaction arose through learned correction compliance, token-logit geometry or another training-dependent mechanism remains open. Root variance was large: four of eight updated/artifact roots had zero persistent cases, while one had 31/32. + +The current source-episode objective supervised the unauthorized action, so a later suppression effect is a particularly useful mechanistic question. Freeze distinct post-correction logit comparisons and matched optimizer controls for any follow-up. + +## 4. Statistical planner improvements + +The generic mechanistic-resolution preflight previously supplied a normal approximation for nominal 80%-power planning. FSI-01 separately requires a positive-floor **one-sided Hoeffding bound** over independent root means. With root effects scaled to [-1,1], familywise alpha, m prespecified comparisons, a prospective effect target d and mechanistic floor tau, a lower bound can exceed tau at the observed mean d only if + +\[ +G\ge \left\lceil\frac{2\log(m/\alpha)}{(d-\tau)^2}\right\rceil,\qquad d>\tau. +\] + +This is a finite-sample **resolution threshold conditional on observing d**, rather than an 80%-power guarantee. At alpha=0.05 and m=4: + +| Target scenario | Floor | Roots to resolve floor if mean equals target | +|---|---:|---:| +| Prospective effect 0.10 | 0.05 | 3,506 | +| Development artifact estimate 121/128, for sensitivity only | 0.05 | 11 | +| Development combined estimate 11/64, for sensitivity only | 0.05 | 591 | +| Absolute negative interaction, scaled by 1/2: 99/256 | 1/40 | 67 | + +The latter three targets were chosen from development observations and cannot substitute for a prospectively frozen power target. + +The preflight update adds a signed effect-direction setting (increase or decrease) and an **optional FSI-01 floor guard**, leaving older approximate-only workflows compatible. A negative interaction must have its direction fixed before a new sealed confirmation cohort. It must be scaled by 1/2 first, because the raw factorial interaction can lie in [-2,2]. A one-sided directional hypothesis chosen during development requires a new untouched confirmation sample and full accounting for the earlier four-arm selection search. + +The nonparametric 95/95 tolerance bound over independent sham-root maxima still needs at least 59 sham roots. This calibrates a **single-root variation envelope**, not the sampling distribution of the mean treatment effect. A 64-root sham calibration and a 64-root effect confirmation answer different questions. A joint confidence statement must allocate error across both steps. + +## 5. Priorities while the GPU is occupied + +Model the separate roles of cue count, position and provenance in the mathematical state. Audit the dose-four to dose-eight root-paired differences before designing a position ablation. Preserve both the original RHT-26 exact receipt and the empirical development archive; register any focused artifact-only follow-up as a new experiment whose comparison-selection history is explicit. Confirmation remains sealed. + +**Sources:** [full development report](https://github.com/MoralityLabAI/Control-Harness/blob/27b210f758dbf45540dbc0e5226cb00e84dc623b/results/rht26_local/development_report.md), [source-bound receipt](https://github.com/MoralityLabAI/Control-Harness/blob/27b210f758dbf45540dbc0e5226cb00e84dc623b/results/rht26_local/receipt.json), original [RHT-26 finite model](../paper/reward_hacking_carryover.md) and [FSI-01](../paper/finite_sample_inference.md). diff --git a/skills/evalmath-mechinterp-power/scripts/preflight.py b/skills/evalmath-mechinterp-power/scripts/preflight.py index 0ff062f7..b4f759ad 100644 --- a/skills/evalmath-mechinterp-power/scripts/preflight.py +++ b/skills/evalmath-mechinterp-power/scripts/preflight.py @@ -43,6 +43,11 @@ def preflight(spec): quantile=fraction(spec.get('sham_quantile'),'sham_quantile') confidence=fraction(spec.get('sham_confidence'),'sham_confidence') if not 00 and not pilot_variance_uninformative else None) mde=(float(variation)+z*sigma/math.sqrt(g) if sigma is not None and not pilot_variance_uninformative else None) + # FSI-01 uses an independent-root, one-sided Hoeffding lower bound. + # Each signed root contrast here has range [-1,1], width 2; interactions + # in [-2,2] must first be multiplied by 1/2 by the caller. + # This is a finite-sample *resolution* requirement if the observed + # confirmation mean equals the chosen target, not an 80%-power claim. + log_family=math.log(m/float(alpha)) + fsi_roots_at_target=(math.ceil(2*log_family/delta**2) if delta>0 else None) + observed_gap=float(observed_mean-variation) + fsi_roots_at_observed=(math.ceil(2*log_family/observed_gap**2) + if observed_gap>0 else None) + fsi_resolvable_mean=float(variation)+math.sqrt(2*log_family/g) + fsi_development_lower=float(observed_mean)-math.sqrt(2*log_family/len(effects)) reasons=[] if not spec.get('pilot_from_development_only') is True:reasons.append('development_pilot_unverified') if not spec.get('heldout_sealed') is True:reasons.append('heldout_unsealed') @@ -92,6 +109,8 @@ def preflight(spec): if pilot_variance_uninformative: reasons.append('zero_variance_pilot_power_uninformative') if required is None or required>g:reasons.append('confirmation_underpowered') + if enforce_fsi and (fsi_roots_at_target is None or fsi_roots_at_target>g): + reasons.append('fsi01_effect_floor_resolution_underpowered') return {'schema':'EvalMath/mechinterp-power-preflight/v1','experiment_id':spec['experiment_id'], 'decision':'REDESIGN_OR_PILOT_ONLY' if reasons else 'READY_FOR_CONFIRMATION', 'reasons':reasons,'independent_unit':spec['independent_unit'], @@ -103,6 +122,12 @@ def preflight(spec): 'planned_comparisons':m,'minimum_exact_sign_test_roots':min_sign_roots, 'approx_worlds_for_80pct_power':required, 'approx_resolvable_effect':mde, + 'effect_direction':direction,'enforce_fsi01_floor':enforce_fsi, + 'fsi01_roots_at_target_for_effect_floor_resolution':fsi_roots_at_target, + 'fsi01_roots_at_observed_pilot_mean_for_effect_floor_resolution':fsi_roots_at_observed, + 'fsi01_resolvable_mean_at_planned_roots':fsi_resolvable_mean, + 'fsi01_development_pilot_lower_bound':fsi_development_lower, + 'fsi01_note':'One-sided independent-root Hoeffding floor resolution, width 2 and Bonferroni m; this is not an 80%-power claim. The observed-pilot projection is post-development sensitivity only. Interactions in [-2,2] must be scaled by 1/2; effect_direction must be frozen before a fresh confirmation readout.', 'limits':'Normal-based power is planning only. A zero-effect zero-variance pilot cannot support extrapolating a hypothetical positive effect. Root and sham independence, symmetry, readout sealing, and the scientific effect floor require independent audits. Repeated outcomes within a root are never additional worlds.'} diff --git a/skills/evalmath-mechinterp-power/scripts/test_preflight_resolution.py b/skills/evalmath-mechinterp-power/scripts/test_preflight_resolution.py index ec9e7363..c29e0272 100644 --- a/skills/evalmath-mechinterp-power/scripts/test_preflight_resolution.py +++ b/skills/evalmath-mechinterp-power/scripts/test_preflight_resolution.py @@ -67,4 +67,43 @@ def test_duplicate_independent_root_rejected(self): with self.assertRaises(ValueError):pf.preflight(p) + def test_fsi01_positive_effect_floor_root_resolution_guard(self): + p=pilot(effects=['1/4']*64,shams=['0']*64,confirm=128,comparisons=4) + p['scientific_min_effect']='1/20' + p['target_effect']='1/10' + p['enforce_fsi01_floor']=True + out=pf.preflight(p) + self.assertEqual(out['fsi01_roots_at_target_for_effect_floor_resolution'],3506) + self.assertEqual(out['fsi01_roots_at_observed_pilot_mean_for_effect_floor_resolution'],220) + self.assertIn('fsi01_effect_floor_resolution_underpowered',out['reasons']) + self.assertEqual(out['decision'],'REDESIGN_OR_PILOT_ONLY') + p['enforce_fsi01_floor']=False + old=pf.preflight(p) + self.assertNotIn('fsi01_effect_floor_resolution_underpowered',old['reasons']) + self.assertEqual(old['decision'],'READY_FOR_CONFIRMATION') + + def test_negative_effect_direction_is_explicit_and_signed(self): + p=pilot(effects=['-3/8']*64,shams=['0']*64,confirm=256,comparisons=4) + p['scientific_min_effect']='1/20' + p['target_effect']='1/4' + p['effect_direction']='decrease' + p['enforce_fsi01_floor']=True + out=pf.preflight(p) + self.assertEqual(out['mean_pilot_effect'],0.375) + self.assertEqual(out['effect_direction'],'decrease') + self.assertEqual(out['fsi01_roots_at_target_for_effect_floor_resolution'],220) + self.assertEqual(out['decision'],'READY_FOR_CONFIRMATION') + p['effect_direction']='increase' + opposite=pf.preflight(p) + self.assertIn('pilot_effect_not_above_mechanistic_variation_floor',opposite['reasons']) + + def test_invalid_fsi_guard_and_direction_rejected(self): + p=pilot() + p['enforce_fsi01_floor']='yes' + with self.assertRaisesRegex(ValueError,'boolean'):pf.preflight(p) + del p['enforce_fsi01_floor'] + p['effect_direction']='two_sided' + with self.assertRaisesRegex(ValueError,'effect_direction'):pf.preflight(p) + + if __name__=='__main__':unittest.main() diff --git a/src/spiral_ln/evaluation_reward_carryover_bridge.py b/src/spiral_ln/evaluation_reward_carryover_bridge.py new file mode 100644 index 00000000..ee42cf26 --- /dev/null +++ b/src/spiral_ln/evaluation_reward_carryover_bridge.py @@ -0,0 +1,145 @@ +"""RHT-26 empirical bridge: exact joint-endpoint and resolution arithmetic. + +The counts are a compact snapshot of the published eight-root Qwen3-1.7B +development cohort at Control-Harness commit 27b210f. This is neither an +independent GPU replication nor confirmation evidence. +""" +from __future__ import annotations + +from dataclasses import dataclass +from fractions import Fraction as Q +from math import ceil, comb, log, sqrt +from typing import Mapping + + +@dataclass(frozen=True) +class JointCounts: + """Full (B,A) endpoint counts, ordered 00, 01, 10, 11.""" + + n00: int + n01: int + n10: int + n11: int + + def __post_init__(self) -> None: + if any(type(n) is not int or n < 0 for n in + (self.n00, self.n01, self.n10, self.n11)): + raise ValueError("outcome counts must be nonnegative integers") + if not self.n: + raise ValueError("at least one case required") + + @property + def n(self) -> int: + return self.n00 + self.n01 + self.n10 + self.n11 + + @property + def before(self) -> Q: + return Q(self.n10 + self.n11, self.n) + + @property + def after(self) -> Q: + return Q(self.n01 + self.n11, self.n) + + @property + def joint(self) -> Q: + return Q(self.n11, self.n) + + @property + def persistence_given_before(self) -> Q | None: + b = self.n10 + self.n11 + return Q(self.n11, b) if b else None + + @property + def recovered_given_before(self) -> Q | None: + b = self.n10 + self.n11 + return Q(self.n10, b) if b else None + + +def factorial_contrasts(arms: Mapping[str, JointCounts]) -> dict[str, Q]: + """Population joint risk differences, not selected-denominator ratios.""" + if set(arms) != {"p00", "p10", "p01", "p11"}: + raise ValueError("expected all four arms") + if len({v.n for v in arms.values()}) != 1: + raise ValueError("this summary requires matched denominators") + a, b, c, d = (arms[name].joint for name in ("p00", "p10", "p01", "p11")) + return { + "artifact_frozen": b-a, + "learning_clean": c-a, + "combined": d-a, + "interaction": d-b-c+a, + "update_given_artifact": d-b, + } + + +def selected_denominator_decomposition( + frozen: JointCounts, updated: JointCounts +) -> tuple[Q, Q, Q]: + """Delta p = Delta P(B)*r_frozen + P_updated(B)*Delta r. + + This selected-group decomposition is exact arithmetic, NOT mediation. + """ + r0, r1 = frozen.persistence_given_before, updated.persistence_given_before + if r0 is None or r1 is None: + raise ValueError("both arms need a positive pre-correction denominator") + pre = (updated.before - frozen.before) * r0 + recovery = updated.before * (r1-r0) + total = updated.joint - frozen.joint + assert pre + recovery == total + return pre, recovery, total + + +def independent_write_threshold(episodes: int, threshold: int, q: Q) -> Q: + """Exact P(Binomial(episodes,q) >= threshold) for a monotone toy model. + + Its monotonicity depends on retained independent writes and a fixed + activation threshold. This family was not fitted to Qwen outputs. + """ + if type(episodes) is not int or episodes < 0: + raise ValueError("episodes must be nonnegative integer") + if type(threshold) is not int or threshold < 1: + raise ValueError("threshold must be positive integer") + if not isinstance(q, Q) or not 0 <= q <= 1: + raise ValueError("q must be rational probability") + return sum((Q(comb(episodes,j))*q**j*(1-q)**(episodes-j) + for j in range(threshold, episodes+1)),Q(0)) + + +def hoeffding_floor_planning(*, target: Q, floor: Q, comparisons: int, + alpha: Q, range_width: Q = Q(2), + confirm_roots: int = 64) -> dict[str, object]: + """FSI-01 one-sided floor *resolution* if observed mean equals target. + + Root effects are bounded in an interval of width range_width. No claim + about 80% statistical power or future mean replicability follows. + """ + if any(type(v) is not Q for v in (target, floor, alpha, range_width)): + raise ValueError("use exact Fraction arguments") + if not (0 <= floor < target <= 1 and 0 < alpha < 1 and range_width > 0): + raise ValueError("invalid numerical planning parameters") + if (type(comparisons) is not int or comparisons < 1 or + type(confirm_roots) is not int or confirm_roots < 2): + raise ValueError("invalid root count or comparison count") + factor = log(comparisons / float(alpha)) + gap = float(target - floor) + required = ceil(float(range_width)**2 * factor / (2*gap**2)) + radius = float(range_width)*sqrt(factor/(2*confirm_roots)) + return { + "min_roots_if_observed_mean_equals_target": required, + "lower_bound_if_observed_mean_equals_target": float(target)-radius, + "resolvable_mean_at_planned_roots": float(floor)+radius, + "floor": str(floor), + "target": str(target), + "comparisons": comparisons, + "range_width": str(range_width), + "scope": "Finite-sample mean-floor resolution only, not 80%-power.", + } + + +def complete_pilot_fixture() -> dict[str, JointCounts]: + """Published dose-8 aggregate data (8 roots x 32 cases per arm).""" + return { + "p00": JointCounts(256,0,0,0), + "p10": JointCounts(0,0,14,242), + "p01": JointCounts(256,0,0,0), + "p11": JointCounts(38,0,174,44), + } diff --git a/tests/test_evaluation_reward_carryover_bridge.py b/tests/test_evaluation_reward_carryover_bridge.py new file mode 100644 index 00000000..18102617 --- /dev/null +++ b/tests/test_evaluation_reward_carryover_bridge.py @@ -0,0 +1,71 @@ +"""CPU-only exact checks for the eight-root RHT-26 empirical bridge.""" +import unittest +from fractions import Fraction as Q + +from spiral_ln.evaluation_reward_carryover_bridge import ( + JointCounts, complete_pilot_fixture, factorial_contrasts, + hoeffding_floor_planning, independent_write_threshold, + selected_denominator_decomposition, +) + + +class RHT26BridgeTests(unittest.TestCase): + def test_exact_four_arm_joint_contrasts(self): + arms=complete_pilot_fixture() + self.assertEqual(factorial_contrasts(arms), { + "artifact_frozen":Q(121,128), + "learning_clean":Q(0), + "combined":Q(11,64), + "interaction":Q(-99,128), + "update_given_artifact":Q(-99,128), + }) + self.assertEqual(arms["p11"].before,Q(218,256)) + self.assertEqual(arms["p11"].persistence_given_before,Q(44,218)) + self.assertEqual(arms["p11"].recovered_given_before,Q(174,218)) + self.assertIsNone(arms["p01"].persistence_given_before) + + def test_selected_denominator_decomposition(self): + arms=complete_pilot_fixture() + before,survival,total=selected_denominator_decomposition(arms["p10"],arms["p11"]) + self.assertEqual(before,Q(-2299,16384)) + self.assertEqual(survival,Q(-10373,16384)) + self.assertEqual(total,Q(-99,128)) + + def test_threshold_model_exact_and_monotone(self): + for q in (Q(0),Q(1,4),Q(3,4),Q(1)): + for threshold in (1,2,3,8): + values=[independent_write_threshold(t,threshold,q) for t in range(10)] + self.assertEqual(values,sorted(values)) + self.assertTrue(all(0 <= v <= 1 for v in values)) + self.assertEqual(independent_write_threshold(2,2,Q(3,4)),Q(9,16)) + self.assertEqual(independent_write_threshold(0,1,Q(1)),Q(0)) + + def test_fsi01_root_bound_is_separate_from_normal_power(self): + params=dict(floor=Q(1,20),comparisons=4,alpha=Q(1,20),confirm_roots=64) + weak=hoeffding_floor_planning(target=Q(1,10),**params) + self.assertEqual(weak["min_roots_if_observed_mean_equals_target"],3506) + strong=hoeffding_floor_planning(target=Q(121,128),**params) + self.assertEqual(strong["min_roots_if_observed_mean_equals_target"],11) + combined=hoeffding_floor_planning(target=Q(11,64),**params) + self.assertEqual(combined["min_roots_if_observed_mean_equals_target"],591) + negative_interaction=hoeffding_floor_planning( + target=Q(99,256), floor=Q(1,40),comparisons=4, + alpha=Q(1,20),confirm_roots=64) + self.assertEqual(negative_interaction["min_roots_if_observed_mean_equals_target"],67) + + def test_validation_and_undefined_conditionals(self): + for args in ((0,0,0,0),(-1,0,0,1),(1,0,False,0)): + with self.assertRaises(ValueError):JointCounts(*args) + with self.assertRaises(ValueError): + factorial_contrasts({"p10":JointCounts(1,0,0,0)}) + with self.assertRaises(ValueError): + selected_denominator_decomposition(JointCounts(1,0,0,0),JointCounts(0,0,0,1)) + with self.assertRaises(ValueError): + independent_write_threshold(2,2,Q(2)) + with self.assertRaises(ValueError): + hoeffding_floor_planning(target=Q(1,20),floor=Q(1,10), + comparisons=4,alpha=Q(1,20)) + + +if __name__ == "__main__": + unittest.main() From 728fe18c44887ae8a1cd0ffbb64a18feda1b1ecc Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Fri, 20 Nov 2026 23:03:18 +0800 Subject: [PATCH 2/2] Clarify RHT-26 pilot writes are host-inserted before actor generation --- docs/rht26_empirical_math_review.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/rht26_empirical_math_review.md b/docs/rht26_empirical_math_review.md index d188de57..b9194fb4 100644 --- a/docs/rht26_empirical_math_review.md +++ b/docs/rht26_empirical_math_review.md @@ -25,6 +25,16 @@ P(M_T\geq k)=\sum_{j=k}^{T}{T\choose j}q^j(1-q)^{T-j}. For fixed q and k, this is monotone in T. The exact implementation in evaluation_reward_carryover_bridge.py checks the family without fitting it to the observed model. The five-case pooled decline in p10 between doses four and eight is a potential discriminator of such a model, subject to paired-root uncertainty and context-position effects. +**Carrier provenance is a material limit of the present pilot.** In the +Control-Harness adapter, source_episode invokes write_structured_cue before +generating the actor's response. The test harness therefore creates these +instructions in its four workspace channels; the model's own response does +not cause the recorded cue write. The reported effect is a host-written, +multi-episode prompt-injection exposure. Demonstrating *endogenous* memory +poisoning or long-range reward hacking will require a follow-up where an +actor-generated declarative action controls the later artifact write and its +subsequent persistence. + ## 2. The end-state is sufficient under the current measurement interface For a Markov-sufficient model whose terminal scoring kernel depends on S_T,