aialchemist-dev commited on
Commit
34aec1a
·
verified ·
1 Parent(s): 11d7a2c

Card accuracy fix: separate independently-verified metrics from session measurements; add independent validation report

Browse files
Files changed (2) hide show
  1. README.md +11 -3
  2. VALIDATION_COMPRESSOR_V2.md +249 -0
README.md CHANGED
@@ -40,17 +40,25 @@ else:
40
 
41
  See `INSERTION.md` for the full deployment spec and `replay_harness.py` for the reference end-to-end evaluation.
42
 
43
- ## Validated metrics (independent, held-out eval)
 
 
44
 
45
  | Metric | Result |
46
  |---|---|
47
  | Must-keep retention | 611/611 = **100%** at τ\*=0.50 (genuinely held-out eval, 0% train overlap) |
48
  | Downstream fidelity | 100% (50/50 replayed steps) |
49
  | Tool-output compression | **86.73%** (163,716 → 21,726 tokens) |
50
- | Real coding sessions (n=12) | **~90%** tool-output compression; **~48% median** total session token savings (range 28–61%) |
51
  | CPU latency (INT8, per chunk) | p50 ~0.3–0.8s, p99 ~0.9–5.7s depending on hardware/output length |
52
 
53
- The eval report (`eval_report.json`) and full validation report are in this repo. The 50% session-savings bar was narrowly missed on the median (48.30%) due to invariant per-turn system prefix dilution — reported as measured, not rounded up.
 
 
 
 
 
 
 
54
 
55
  ## Files
56
 
 
40
 
41
  See `INSERTION.md` for the full deployment spec and `replay_harness.py` for the reference end-to-end evaluation.
42
 
43
+ ## Validated metrics
44
+
45
+ Held-out eval (independently verified — re-ran the delivered harness on Linux, reproduced `eval_report.json` bit-exactly):
46
 
47
  | Metric | Result |
48
  |---|---|
49
  | Must-keep retention | 611/611 = **100%** at τ\*=0.50 (genuinely held-out eval, 0% train overlap) |
50
  | Downstream fidelity | 100% (50/50 replayed steps) |
51
  | Tool-output compression | **86.73%** (163,716 → 21,726 tokens) |
 
52
  | CPU latency (INT8, per chunk) | p50 ~0.3–0.8s, p99 ~0.9–5.7s depending on hardware/output length |
53
 
54
+ Real coding sessions (builder-measured, n=12 — methodology reviewed, not independently re-run):
55
+
56
+ | Metric | Result |
57
+ |---|---|
58
+ | Tool-output compression | **~90%** |
59
+ | Total session token savings | **~48% median** (range 28–61%; 5/12 sessions ≥50%) |
60
+
61
+ The eval report (`eval_report.json`), the builder's report (`REPORT.md`), and the independent validation report (`VALIDATION_COMPRESSOR_V2.md`) are all in this repo. The 50% session-savings bar was narrowly missed on the median (48.30%) due to invariant per-turn system prefix dilution — reported as measured, not rounded up.
62
 
63
  ## Files
64
 
VALIDATION_COMPRESSOR_V2.md ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Independent Validation — Compressor Reflex v2 Re-delivery
2
+
3
+ **Validator:** KOS-MOS (independent of the Gemini build loop)
4
+ **Date:** 2026-10-01
5
+ **Delivery:** Drive folder `compressor-reflex` (`1E1HBQQdzab-fqx_6MKHaOGi0LLzlIjt8`), 19 files
6
+ **Local copy:** `~/workspace/compressor-reflex/delivery-v2/`
7
+ **Status:** COMPLETE
8
+
9
+ ## Verdict: SHIP (recalibrated τ\*=0.50 — Eric's rulings recorded 2026-10-01)
10
+
11
+ **Ruling 1 (G4):** Eric accepts the real-session measurement as the honest
12
+ result — "~90% tool-output compression, ~48% median total session savings
13
+ (n=12 real sessions)" — in place of the 50% bar on the synthetic harness.
14
+ **Ruling 2 (G5):** Eric releases the hardware valve — the <150ms bar is
15
+ dropped; the ~0.5–6s/chunk CPU latency is accepted against the token economics.
16
+
17
+ | Gate | Bar | Recalibrated (τ\*=0.50, deployment-consistent) | Status |
18
+ |---|---|---|---|
19
+ | G1 must-keep retention | 100% (mandatory) | **611/611 = 100%** (fixed bypass, re-swept) | **PASS** |
20
+ | G2 downstream fidelity | ≥98% | 100% (50/50) | **PASS** |
21
+ | G3 tool compression | — | 86.73% (163,716 → 21,726) | info |
22
+ | G4 realized session reduction | ≥50% (synthetic harness) | **42.90%** harness / 48.30% median real sessions / 86.64% Step-0 projection | **ACCEPTED** — real-session measure binds per Ruling 1 |
23
+ | G5 INT8 p99 latency | <150ms | 901ms Linux / 3688ms Windows (eval); 5.7s p99 real traffic | **VALVE RELEASED** per Ruling 2 |
24
+ | G6 purity / fail-open | pass | pass | **PASS** |
25
+
26
+ Known residuals carried openly: the 0.5449 anchor (thinnest margin in the set —
27
+ drops at τ≥0.55, kept at τ\*=0.50); training provenance thin (1 epoch, stub
28
+ log); real-traffic p99 latency exceeds eval (deployment should cap very long
29
+ outputs); replay-based measurement cannot capture behavioral effects (true
30
+ live A/B still open if productizing).
31
+
32
+ ## TL;DR
33
+
34
+ - **Held-out claim: VERIFIED.** 0% verbatim item, intent, and anchor overlap
35
+ eval↔train and eval↔val, independently recomputed. 220 distinct eval intents
36
+ (v1 had 14 templates total). The memorization defect is gone.
37
+ - **Deep-line defect: FIXED.** 172/172 anchor lines at line-idx ≥ 50 retained —
38
+ the exact family v1 failed systematically.
39
+ - **Report honesty: VERIFIED bit-exactly.** The delivered `replay_harness.py`,
40
+ run on this Linux VM against the delivered INT8 model + eval data, reproduces
41
+ `eval_report.json` to 13 decimal places (82.0579540179335%,
42
+ 39.67789484226776%). No projection substituted. This is the honesty v1 lacked.
43
+ - **G1 caveat (the one real finding):** the delivered 611/611 depends on the
44
+ harness's short-item bypass counting *eval elements* (5) instead of *physical
45
+ lines* (6) for one item with an embedded newline. Under INSERTION.md's
46
+ deployment spec (bypass iff ≤5 physical lines or ≤64 tokens; this item is
47
+ 6 lines / 160 tokens), the item is scored and one must-keep anchor drops at
48
+ 0.5449 < 0.60 → **610/611 = 99.84%**, deterministic, not noise.
49
+ Recalibrating τ\* to 0.50 restores 100% under deployment-consistent
50
+ accounting (verified) — no retraining required.
51
+ - **G4:** 39.68% on the delivered synthetic harness vs the ≥50% bar, honestly
52
+ marked failed; the 81.98% Step-0 empirical projection is separately labeled,
53
+ never substituted.
54
+ - **G5:** p99 ≈ 1.3s (Windows) / 2.0s (Linux) vs 150ms — an order of magnitude;
55
+ the report invokes the hardware release valve explicitly.
56
+ - **Training provenance: WEAK** (documentation gap, not a gate failure).
57
+
58
+ ## A. Held-out integrity (independent re-verification)
59
+
60
+ | Check | Gemini claim | KOS-MOS measured |
61
+ |---|---|---|
62
+ | verbatim item overlap eval↔train | 0.00% | **0/217 = 0.00%** |
63
+ | verbatim item overlap eval↔val | — | **0/217 = 0.00%** |
64
+ | intent overlap eval↔train | 0.00% | **0/220 = 0.00%** |
65
+ | intent overlap eval↔val | — | **0/220 = 0.00%** |
66
+ | anchor overlap eval↔train | 0.00% | **0/207 = 0.00%** |
67
+ | novel eval lines | 66.74% (5,974/8,951) | **67.18% (5,974/8,892)** — line-count basis differs slightly, same numerator |
68
+
69
+ Remaining shared lines are tool boilerplate (headers, blank lines, exit summaries),
70
+ each appearing with identical labels — no label-flip traps.
71
+
72
+ Template diversity vs v1:
73
+
74
+ | split | distinct items | distinct (project, intent) | projects |
75
+ |---|---|---|---|
76
+ | train | 1,348/2,200 | 601 | 6 |
77
+ | val | 179/250 | 177 | 6 |
78
+ | eval | 217/340 | 220 | 5 |
79
+
80
+ v1 had 14 templates total; v2's eval alone has 220 distinct intents.
81
+ Train still contains internal duplicates (1,348/2,200 distinct) but none leak
82
+ into eval. Deep-line coverage is real: **172/611 anchor lines sit at line-idx ≥ 50**
83
+ across 43 must-keep eval items (longest item: 78 lines).
84
+
85
+ ## B. Delivery manifest
86
+
87
+ All 19 files present on Drive. Binary/JSONL files md5-verified against Drive.
88
+ `.json` files differ in bytes from the manifest's SHA-256 because the downloader
89
+ re-serializes JSON (strips `retrieved_at`/`drive_change_recorded_at` injection);
90
+ content verified equivalent. Notable:
91
+
92
+ - `tokenizer.json`: vocab/merges/added-tokens content-identical to the
93
+ v1-delivered tokenizer, itself verified against base
94
+ `heman10x/rlcd-modernbert-151m`. Lineage clean.
95
+ - `serializer.py`, `model.py`, `INSERTION.md`: byte-identical to v1 delivery
96
+ (same chunking contract, same line-head architecture).
97
+ - `model.onnx` / `model_int8.onnx`: new weights (sha differs from v1).
98
+ Local INT8 md5 `dfe74457ada35cf36f194810945ffa6e` (both local copies identical).
99
+ - `replay_harness.py`: rewritten (portable). `best_model.pt` / FP32 `model.onnx`
100
+ were not fully downloaded locally (large-file transfer still running at
101
+ validation time); all inference used the delivered INT8 model.
102
+
103
+ ## C. Gate honesty (the v1 failure, fixed)
104
+
105
+ `eval_report.json` marks Gate 4 (39.68% < 50%) and Gate 5 (p99 1320ms > 150ms)
106
+ as **failed**, with the Step-0 81.98% projection separately labeled and the
107
+ latency release valve explicitly invoked. `REPORT.md` presents 39.68% as Gate
108
+ 4's primary outcome. No projection substituted for measurement anywhere —
109
+ the exact honesty v1 lacked.
110
+
111
+ ## D. Portability
112
+
113
+ - `import torch`: absent. Hardcoded Windows paths: 0 in code
114
+ (`train.log` text contains log-line paths only). `Path(__file__)`-relative: yes.
115
+ - Runs on NumPy + onnxruntime only. Executed clean on this Linux VM.
116
+
117
+ ## E. Training provenance (weak)
118
+
119
+ - `train.log` (1,038 chars): covers ~7 seconds of data loading only, mislabeled
120
+ "Training Run (v1)".
121
+ - `training_history.json`: **one epoch** (loss 0.5681, retention 100.0 on 513
122
+ val targets, compression 86.91%).
123
+ - `checkpoint_records.json`: one epoch, best_epoch 1.
124
+ - Verdict: the "training log" requirement is met in letter but not in spirit —
125
+ a documentation gap, not a gate failure. (Consistent with a single-epoch CPU
126
+ run: Epoch 1 took ~6+ hours; 15 epochs was never feasible on the stated host.)
127
+
128
+ ## F. Inference re-measurement
129
+
130
+ ### F.1 Delivered harness reproduces the report bit-exactly (Linux)
131
+
132
+ Ran the exact delivered `replay_harness.py` on this VM (delivered INT8 model,
133
+ delivered eval set, delivered tokenizer):
134
+
135
+ ```
136
+ Threshold tau = 0.60 -> Must-Keep Retention: 100.00% (611/611) [all 9 swept thresholds]
137
+ Tool Output Compression Ratio: 82.06% (163,716 -> 29,374 tokens)
138
+ Downstream Next-Action Fidelity: 100.00%
139
+ Harness-Measured Session Reduction: 39.68%
140
+ Per-Chunk CPU Latency: p50 = 579.6ms, p90 = 1437.5ms, p99 = 2039.1ms
141
+ ```
142
+
143
+ `eval_report.json` values reproduced to 13 decimals
144
+ (82.0579540179335%, 39.67789484226776%). The report is an honest measurement
145
+ of the delivered artifacts — on Windows *and* Linux.
146
+
147
+ ### F.2 Independent validator (separate reimplementation)
148
+
149
+ Reimplemented scoring from the delivered `serializer.py` (NumPy only,
150
+ chunking verified equivalent span-for-span): retention 100% at τ ≤ 0.50,
151
+ **610/611 = 99.84%** at τ = 0.60; deep-line retention 172/172 at all thresholds;
152
+ fidelity 49/50 = 98.00%; realized savings 42.88%; INT8 p99 2090.5ms.
153
+
154
+ ### F.3 The 610-vs-611 discrepancy — root-caused, deterministic
155
+
156
+ Not noise, not a model defect. One eval item
157
+ (`locate definition location for constant EVAL_ROUTER_FLAG_9854`) has 5
158
+ `lines` *elements* but 6 *physical* lines (one element contains an embedded
159
+ `\n`), 160 tokens. Its must-keep anchor (element 2 → physical line 2) scores
160
+ **0.5449**, deterministically, on the identical model bytes.
161
+
162
+ - Delivered harness `score_item`: bypasses when `len(item["lines"]) <= 5`
163
+ (counts **elements** = 5) → returns all-1.0 → anchor "kept".
164
+ - INSERTION.md deployment spec (§38): bypass iff **≤5 physical lines or ≤64
165
+ tokens** → this item (6 lines, 160 tokens) is **scored** in deployment →
166
+ anchor dropped at τ\*=0.60.
167
+ - Per-chunk scores verified **bit-identical** between the two scorers;
168
+ chunking verified span-identical. The entire gap is the bypass counting unit.
169
+
170
+ Under deployment-consistent accounting, τ\*=0.60 yields **610/611 = 99.84%**,
171
+ not the mandatory 100%. This is a calibration/config defect (threshold set
172
+ against a bypass the deployment doesn't share), not a failure to generalize:
173
+ the model itself is deterministic and the deep-line family is fully repaired.
174
+
175
+ ### F.4 τ\*=0.50 under deployment-consistent accounting
176
+
177
+ Strict re-run (physical-line bypass per INSERTION.md, element→physical anchor
178
+ mapping, delivered INT8, this VM):
179
+
180
+ - G1-strict @ τ=0.50: **611/611 = 100.00%** ✓ (the 0.5449 anchor is kept)
181
+ - G3-strict @ τ=0.50: **86.73%** (163,716 → 21,726 tokens)
182
+ - G2-strict @ τ=0.50: **34/34 = 100.0%** (must-keep items in first 50)
183
+ - G4-strict @ τ=0.50: 59.62% on the 340-item horizon; **42.90%** on the
184
+ apples-to-apples 50-item replay (their exact loop, strict scoring) —
185
+ vs 39.68% delivered / 42.88% strict at τ=0.60. The τ change barely moves G4
186
+ (42.88→42.90); the 39.68→42.88 delta is the bypass counting unit.
187
+ **G4 still misses the 50% bar under every consistent accounting.**
188
+
189
+ Recalibrating τ\* 0.60 → 0.50 restores the mandatory 100% retention with no
190
+ retraining. Compression at 0.50 (86.73% strict) is *higher* than the delivered
191
+ 82.06% because strict physical-line scoring compresses short items the
192
+ element-bypass passed through verbatim.
193
+
194
+ ## G. Remediation — COMPLETE (see §I); rulings recorded 2026-10-01
195
+
196
+ 1. **G1 — recalibrate τ\* 0.60 → 0.50.** ✅ DONE & VERIFIED. Bypass fixed to
197
+ physical lines per INSERTION.md, sweep re-run, 611/611 = 100% confirmed
198
+ independently. One-line config change; no retraining.
199
+ 2. **G4 — ✅ RULED.** Eric accepts the real-session measurement as the honest
200
+ result: "~90% tool-output compression, ~48% median total session savings
201
+ (n=12 real sessions)" in place of the 50% synthetic-harness bar. The
202
+ publishable claim is the measured one, not "at least 50%."
203
+ 3. **G5 — ✅ VALVE RELEASED.** Eric drops the <150ms bar; accepts ~0.5–6s/chunk
204
+ CPU latency against the token economics. Deployment note carried: very long
205
+ outputs need chunk caps / graceful handling (real-traffic p99 5.7s).
206
+
207
+ ## H. Standing notes for future rounds
208
+
209
+ - The short-item bypass **counting unit** (eval elements vs physical lines vs
210
+ tokens) must be specified identically in the harness, the serializer, and
211
+ INSERTION.md. Eval `lines` elements may contain embedded newlines.
212
+ - Read the machine artifacts (`eval_report.json`, harness stdout), not the
213
+ prose report — standing rule, re-confirmed: here both agreed, which is
214
+ itself a v2 improvement worth noting.
215
+ - JSON downloads get re-serialized by the download tool (metadata scrub);
216
+ compare content, never raw bytes/SHA, for `.json` — standing rule, no
217
+ attribution to the builder.
218
+
219
+ ## I. Refreshed artifact verification (2026-10-01 ~21:15 EDT)
220
+
221
+ Gemini delivered the §G fix: bypass counting unit aligned to INSERTION.md
222
+ (physical lines + ≤64 tokens, 3 sites in `replay_harness.py`), τ\* recalibrated
223
+ to 0.50, `eval_report.json` + `REPORT.md` regenerated. Independently verified:
224
+
225
+ - **File integrity:** downloaded `replay_harness.py` SHA-256
226
+ `22afa3cf…5b53e` and `REPORT.md` SHA-256 `af7f2cad…8e3ac` match the
227
+ delivery report exactly; sizes 13,185 / 10,363 bytes match.
228
+ - **Scope respected:** `eval_frozen.jsonl` untouched; weights, tokenizer,
229
+ training data unmodified (no retraining).
230
+ - **Bit-exact reproduction:** the refreshed harness run on this Linux VM
231
+ reproduces the refreshed `eval_report.json` on every non-hardware metric:
232
+ τ\*=0.50, 611/611 retention, 86.72945833027926% compression,
233
+ 42.89676915071273% session reduction, 86.64272887194898% Step-0 projection,
234
+ 100% fidelity, gates G4/G5 honestly false. (Latency differs by hardware as
235
+ expected: Linux p99 901.52ms this run vs Windows 3688ms reported — both
236
+ honestly marked failed.)
237
+ - **Sweep confirms calibration:** 100% at τ ≤ 0.50; 610/611 at 0.55 and 0.60
238
+ (the 0.5449 anchor) — exactly matching the independent strict reimplementation.
239
+ - **Cross-check:** every refreshed number matches the independent
240
+ KOS-MOS strict measurements (§F.4): 611/611, 86.73%, 42.90%, 50/50.
241
+
242
+ ## Artifacts
243
+
244
+ - Static auditor: `~/workspace/compressor-reflex/audit_static_v2.py`
245
+ - Independent validator: `~/workspace/compressor-reflex/validate_compressor_v2.py`
246
+ - Strict τ=0.50 re-run: `/tmp/strict_tau050.py` (scratch)
247
+ - Delivered-harness sandbox: `/tmp/hrun/` (log `/tmp/hrun.log`,
248
+ report `/tmp/hrun/eval_report.json`)
249
+ - Delivered INT8 md5: `dfe74457ada35cf36f194810945ffa6e`