Skip to content

docs(r12): v1.2 §6.1 kv_cache_compression_ratio semantics clarification + doc-consistency sweep - #35

Merged
synapticode-ai merged 2 commits into
mainfrom
docs/r12-v1.2-compression-ratio-semantics-2026-05-18
May 17, 2026
Merged

docs(r12): v1.2 §6.1 kv_cache_compression_ratio semantics clarification + doc-consistency sweep#35
synapticode-ai merged 2 commits into
mainfrom
docs/r12-v1.2-compression-ratio-semantics-2026-05-18

Conversation

@synapticode-ai

Copy link
Copy Markdown
Collaborator

Summary

R12 v1.2 amendment clarifying §6.1 kv_cache_compression_ratio field semantics for two hook architectures (round-trip vs propagation), folding in a doc-consistency sweep parallel to yesterday's R7-B v1.2 precedent. Companion to PR #34 (which already emits the v1.2-conformant theoretical ratio); PR #34 amendment to bump its SPEC_VERSION constant lands next.

Why

PR #34's A'' R12 sweep wrapper implementation surfaced that §6.1's kv_cache_compression_ratio field — described as "computed by tern_kv_ppl_bench.py from pre/post past_key_values byte sizes" — was vacuous under β1a make_b_mse_hook_uniform's round-trip hook architecture:

  • Input FP16 K/V → encode → quantize → decode → output FP16 K/V at identical shape and dtype
  • Output bytes equal input bytes → measured ratio = 1.0 always
  • The operating point's actual compression (4×, 8×, 16× depending on b_mse) lives in the codebook-encoded intermediate representation that never propagates outside the hook

PR #34 already emitted the theoretical ratio (16 / b_mse) with explanatory notes field; v1.2 spec catches up with the implementation reality.

Changes

Primary amendment (briefing scope)

  • §6.1 v1.2 clarification block appended after the per-point schema example — disambiguates field semantics for round-trip hooks (theoretical 16 / b_mse) vs propagation hooks (pre/post bytes, not yet implemented in tern-core)
  • §11 new ### v1.1 → v1.2 cascade (2026-05-18) entry at top — full cascade narrative + cross-references

Doc-consistency sweep (Phase B dispositions, ratified)

# Item Action
1 Front-matter title + Document status stamps at v1.0 (hygiene gap from v1.0 → v1.1 cascade) Bump v1.0 → v1.2 directly (parallel to R7-B v1.2 PR #33 precedent)
2 §7 schema example spec_version and methodology_consumed lagged at v1.0 Bump to v1.2 each
3 §11 heading baked-in cascade pattern (## §11 Change log — v0.1 → v0.2 (2026-05-15)) inconsistent with R7-B convention Refactor to clean ## §11 Change log; demote v0.1 → v0.2 cascade body to ### v0.1 → v0.2 cascade (2026-05-15) sub-entry with #### sub-sub-sections
4 Tool-name divergence: 5 live spec references to anticipated tern_kv_ppl_bench.py vs actual PR #34 artifact tern_r12_sweep.py Update §4 / §6.1 / §10 live references to tern_r12_sweep.py; preserve §11 historical mentions verbatim (they quote what v0.2 spec actually said)

Footer

Rewritten to v1.2 ratification (2026-05-18) with §6.1 clarification + doc-consistency sweep mention; preserves v1.1 lessons-learned phrasing.

§11 ordering note (transparency)

### v1.1 → v1.2 cascade (2026-05-18) is at top per Rob's explicit Phase B instruction ("prepend the new ... cascade ... at top"). Existing historical sub-entries (v0.1 → v0.2, v0.2 → v1.0, v1.0 → v1.1) left in their original chronological-forward order — strict newest-first reordering across all sub-entries would be a 3-line follow-up edit if desired, but went beyond explicit Phase B disposition.

Methodology version note

  • Spec version: v1.1 → v1.2 (field semantics clarification + doc-consistency)
  • Schema versions: ppl_headroom_kv_cache_point/1.0 and ppl_headroom_kv_cache_sweep/1.0 — both unchanged (data format identical; clarification is methodology, not data)
  • PR feat(r12): sweep wrapper for KV-cache compression PPL headroom diagnostic (A'') #34 amendment (companion, lands separately): bumps SPEC_VERSION constant in tools/tern_r12_sweep.py from v1.1 to v1.2 so post-amendment sweep runs emit v1.2 in their JSON metadata

Background sweep note

The full A'' sweep launched 2026-05-17 (PID 8767, still running unattended) was started under v1.1 SPEC_VERSION. Its emitted JSONs will say spec_version: kv_cache_compression_ppl_headroom_diagnostic v1.1 — methodologically correct (the sweep WAS executed under v1.1 understanding; PR #34's implementation already emitted the v1.2-conformant theoretical ratio + explanatory notes). Sweeps launched after PR #34's amendment will emit v1.2.

Test plan

  • §6.1 v1.2 clarification block landed between schema example and §6.2 header
  • §7 schema example spec_version + methodology_consumed bumped to v1.2
  • §11 refactored to clean ## §11 Change log heading; ### v1.1 → v1.2 cascade at top; ### v0.1 → v0.2 cascade sub-entry with #### Substantive/Documentary/Unchanged sub-sub-sections
  • Tool-name audit: 5 live references updated to tern_r12_sweep.py; 2 historical mentions preserved as tern_kv_ppl_bench.py
  • Front matter at v1.2; footer at v1.2 (2026-05-18)
  • Diff: only doc changes (+58/−15)

Cross-references

🤖 Generated with Claude Code

…on + doc-consistency sweep

Carry-forward from A'' R12 sweep wrapper workstream (PR #34): the sweep
wrapper implementation surfaced that R12 v1.1 §6.1's compression-ratio
field was vacuous under β1a make_b_mse_hook_uniform's round-trip hook
architecture (input bytes == output bytes; "compression" lives in the
codebook-encoded intermediate that never propagates outside the hook).

v1.2 clarifies the field semantics for two hook architectures:
- Round-trip hooks: compute theoretically from codebook parameters
  (16 / b_mse for FP16 baseline)
- Propagation hooks (not yet implemented in tern-core): measure from
  pre/post byte sizes as originally described

No schema-level changes (point/sweep schemas remain at /1.0); field-
semantics clarification only. Spec version bumps v1.1 → v1.2; companion
amendment in PR #34 bumps the SPEC_VERSION constant in
tools/tern_r12_sweep.py.

Phase B surfaced four additional doc-consistency items dispositioned in
scope (parallel to yesterday's R7-B v1.2 precedent):
  1. Front-matter title + Document status stamps lagged at v1.0
     (bumped directly to v1.2, folding the v1.1 hygiene gap from the
     v1.0 → v1.1 cascade — same precedent as R7-B v1.2)
  2. §7 schema example spec_version and methodology_consumed bumped to
     v1.2 (parallels R7-B v1.2 §7 fix)
  3. §11 heading refactored to clean `## §11 Change log` + per-cascade
     `###` sub-entries (newest-first); v0.1 → v0.2 cascade content
     demoted to a `### v0.1 → v0.2 cascade` sub-entry with internal
     `####` sub-sub-sections
  4. Tool-name divergence: 5 live references to anticipated
     `tern_kv_ppl_bench.py` updated to actual artifact
     `tern_r12_sweep.py` (§4 / §6.1 / §10). Historical mentions in §11
     v0.1 → v0.2 cascade preserved verbatim as documentary record of
     what v0.2 spec actually said.

Footer rewritten to v1.2 ratification (2026-05-18) with §6.1
clarification + doc-consistency sweep mention.

Methodology workflow precedent: implementation reality discovered during
workstream execution feeds back into spec amendments. PR #34's wrapper
already emitted the v1.2-conformant theoretical ratio with explanatory
notes during its initial design — v1.2 doc catches up with the
implementation.

Cross-references:
  - A'' workstream: PR #34 (sweep wrapper implementation)
  - β1a factory: PR #27 (make_b_mse_hook_uniform)
  - Cache-shape contract: PR #32 (DynamicCache return)
  - R7-B v1.2 doc-consistency precedent: PR #33

Copyright (c) 2025-2026 Gamma Seeds Pte Ltd. All rights reserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
synapticode-ai pushed a commit that referenced this pull request May 17, 2026
Companion to docs(r12) PR #35 (R12 v1.2 §6.1 kv_cache_compression_ratio
semantics clarification + doc-consistency sweep). The implementation
already emitted theoretical compression ratios per v1.2 semantics; this
bump aligns the spec_version field with the canonical doc version.

Per-point JSONs and aggregate manifests from sweeps launched after this
commit will emit spec_version 'kv_cache_compression_ppl_headroom_diagnostic
v1.2'. The currently-running unattended sweep (PID 8767, launched
2026-05-17 under v1.1) continues emitting v1.1 — methodologically correct
for sweeps started before the amendment landed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase F-3 cleanup of yesterday's PR #35 §11 refactor: the initial
restructure prepended v1.1→v1.2 at top but left the three historical
entries in chronological-forward order (v0.1→v0.2, v0.2→v1.0, v1.0→v1.1).
The R7-B convention this PR aimed at is strict newest-first across ALL
entries.

Reordering:
- v1.1 → v1.2 cascade (2026-05-18)        [unchanged, top]
- v1.0 → v1.1 cascade (2026-05-16)        [moved up from bottom]
- v0.2 → v1.0 promotion (2026-05-15)      [unchanged, middle]
- v0.1 → v0.2 cascade (2026-05-15)        [moved down from top of legacy]

No content changes; block-level moves only. Future R12 amendments now
have an unambiguous "prepend at top" pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@synapticode-ai
synapticode-ai marked this pull request as ready for review May 17, 2026 07:45
@synapticode-ai
synapticode-ai merged commit af54179 into main May 17, 2026
1 check 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