Skip to content

diff drift soak: mechanical long-chain pytest + fluency --diff-soak depth eval#75

Merged
inth3shadows merged 1 commit into
mainfrom
diff-drift-soak
Jul 13, 2026
Merged

diff drift soak: mechanical long-chain pytest + fluency --diff-soak depth eval#75
inth3shadows merged 1 commit into
mainfrom
diff-drift-soak

Conversation

@inth3shadows

Copy link
Copy Markdown
Owner

Why

The #8/#20 follow-up gating any --diff default-flip. Per-hop losslessness is proven at encode time and unit-pinned, but nothing exercised drift: (1) does client-side reconstruction stay exact hundreds of chained hops deep, across keyframes, shape flips, and reconnects; (2) does model comprehension degrade as consecutive diffs chain off one full anchor (production allows up to diff_keyframe_interval = 5 before re-anchoring).

Mechanical half — tests/test_diff_soak.py

Drives the real Interceptor with an independent client-side reconstructor (ModelView, built only on the public decode functions — it never peeks at proxy state), asserting reconstruction == raw payload at every hop:

Behavioral half — terse fluency --diff-soak

Builds real depth-1..K chain windows from the corpus (chronological, every hop must admit a lossless diff), scores the same final-state questions as (full anchor + k wires) vs a full-terse control — no system primer, production condition — and reports accuracy by depth with worst-model verdicts overall and at the deepest depth (build_diff_soak_report; --soak-depth/--soak-windows to size it).

Enabler: _flat_record_questions — fluency-local questions for single flat-record payloads (keys-count + deterministic scalar lookups). kb payloads are per-block flat dicts that generated zero questions, leaving the deepest real chains untestable; same fluency-local pattern as #72's nested-record source, codec/tabularizer rules untouched.

Live result (this PR's gate)

Loopback gateway, deepseek-v4-flash + glm-5.2, 3 trials, ~50 real-corpus windows, depths 1–5:

gate worst model chain full gap verdict
overall deepseek-v4-flash 94% 96% −2% ±1 PASS (5% tol)
depth 5 (production bound) deepseek-v4-flash 96% 97% −1% ±2 PASS (5% tol)

No depth-correlated drift: the depth-3 dip (−6/−8%) hits both models on the same windows and recovers at depths 4–5 — window-specific, not accumulation.

Verification

  • 471 tests pass (+8: 3 soak, 5 fluency incl. flat-record pins), ruff clean.
  • Docs: USAGE (new --diff-soak section), TECHNICAL (soak note on the diff limitation bullet), README (status line).

…epth eval

The #8/#20 follow-up gating any --diff default-flip: per-hop losslessness was
proven, but nothing exercised DRIFT — reconstruction and comprehension over
long chains of consecutive diffs.

Mechanical (tests/test_diff_soak.py): drives the real Interceptor with an
independent client-side reconstructor (ModelView, public decode fns only) and
asserts exactness at EVERY hop — 400 interleaved hops across three evolving
workloads (records / dict-map / text log) with error interludes and a mid-soak
reconnect; a 300-diff unbounded chain (interval 0); a 200-step text-only
chain. Keyframe cadence <=5 verified throughout. Zero drift.

Behavioral (fluency --diff-soak [--soak-depth K --soak-windows N]): builds
real depth-1..K chain windows from the corpus (every hop must admit a lossless
diff), scores final-state questions as (full anchor + k wires) vs full-terse
control, reports accuracy by depth + worst-model verdicts overall and at the
deepest depth (build_diff_soak_report).

Enabler: _flat_record_questions — fluency-local questions for single flat
record payloads (keys-count + deterministic scalar lookups), the keys-diff
surface the soak was blind to (kb payloads are per-block flat dicts). Same
pattern as #72's nested-record source; codec/tabularizer rules untouched.

Live result (loopback gateway, deepseek-v4-flash + glm-5.2, 3 trials,
~50 real corpus windows): overall worst gap -2% +/-1, depth-5 gap -1% +/-2 —
PASS at 5% tolerance, no depth-correlated drift.

471 tests pass (+8), ruff clean.
@inth3shadows inth3shadows merged commit e42d5bd into main Jul 13, 2026
5 checks passed
@inth3shadows inth3shadows deleted the diff-drift-soak branch July 13, 2026 19:41
inth3shadows added a commit that referenced this pull request Jul 13, 2026
The validation program that kept --diff opt-in is complete — pair fluency
(4-model panel 100%), nested-record coverage (#72), and the drift soak (#75:
mechanical zero-drift at depth 300, behavioral depth-1..5 PASS on real corpus
chains). The default now matches the measured reality.

- Policy.diff defaults True; load_policy's doc.get("diff") default flips to
  match. An explicit policy-file "diff": false is still honored.
- proxy: tri-state CLI — --diff forces on (only useful against an opting-out
  policy file), new --no-diff forces off, neither keeps the policy value.
  Mutually exclusive, exit 2. multiproxy diff_override becomes Optional[bool]
  (None = leave each peer's policy alone) so --no-diff is proxy-wide too.
- install-mcp: diff param is tri-state — plain wraps write NO diff flag and
  inherit the proxy default; --diff/--no-diff bake an explicit override into
  the entry; keyframe-interval no longer requires --diff (but is dropped with
  --no-diff, where it would be dead weight).
- Tests: the two off-by-default pins become on-by-default + policy-false
  opt-out pins; install-mcp tri-state covered (None drops flags, False bakes
  --no-diff). 471 pass, ruff clean.
- Docs: README tier/Status, TECHNICAL diff bullet (opt-in rationale rewritten
  as history + the compaction residual keeps --no-diff as escape hatch),
  USAGE proxy/install-mcp/text-diff sections; also documents the stash
  hand-edit gotcha found during the #74 rollout.

Live smoke: flagless proxy diffs the repeat structure call (117,587 -> 205
chars); --no-diff sends the full form both times.
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