From 2953eec764aaafd0e3a46475a3698de889f98f32 Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Thu, 12 Nov 2026 01:03:50 +0800 Subject: [PATCH 1/3] docs(blog): foreground compaction-cycle structured delta cascade from 100% Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- .../public/blog/context-delivery/index.html | 23 +- .../context-delivery/context-cascade-en.svg | 447 +++++++++++++++ .../context-delivery/context-cascade-zh.svg | 447 +++++++++++++++ .../multitask-byte-ratios-en.svg | 530 +++++++++--------- .../multitask-byte-ratios-zh.svg | 530 +++++++++--------- apps/presentation/site/public/blog/index.html | 4 +- .../blog/zh/context-delivery/index.html | 23 +- .../site/public/blog/zh/index.html | 4 +- .../scripts/generate-long-horizon-audit.py | 272 ++++++++- examples/blog-bilingual-index-smoke.mjs | 15 + 10 files changed, 1725 insertions(+), 570 deletions(-) create mode 100644 apps/presentation/site/public/blog/images/context-delivery/context-cascade-en.svg create mode 100644 apps/presentation/site/public/blog/images/context-delivery/context-cascade-zh.svg diff --git a/apps/presentation/site/public/blog/context-delivery/index.html b/apps/presentation/site/public/blog/context-delivery/index.html index 79650dd58d..6eed4a5428 100644 --- a/apps/presentation/site/public/blog/context-delivery/index.html +++ b/apps/presentation/site/public/blog/context-delivery/index.html @@ -6,18 +6,21 @@ -
← All articles

Context delivery

An Agent needs a way to look things up, too

One voice task, from choosing facts to fitting the first read, preserving exact values, and recovering without replaying work.

-

Long-running work accumulates material: the original goal, later constraints, attempted routes, failed experiments and current progress. Sending everything again on each continuation repeats more and more content; keeping only a summary can make the original basis of a decision difficult to recover.

-

LoopX's context delivery separates these jobs: preserve complete sources, read the facts needed for the current decision, expand supporting material around questions, and reuse unchanged structures exactly within a valid compaction cycle.

-

Results first: progressive reading, deltas and task ablation

-

Eight tasks: progressive reading and in-cycle deltas

-

This section recalculates the published eight-task Four-Arm Context ON 18h aggregates to distinguish Progressive and in-cycle Delta transport costs. The source reports 213 model-facing wakes: 101 new-session or post-compaction baseline reads and 112 in-cycle continuations. Per-task cells retain the published values; totals are recomputed from those cells. Raw per-wake logs are not included here.

+
← All articles

Context delivery

An Agent needs a way to look things up, too

Step down from 100% saved context: fold long-tail history on demand, reuse verified structures as compaction-cycle deltas, and reset cleanly on compaction.

+

Long-running work accumulates material: the original goal, later constraints, attempted routes, failed experiments and current progress. Sending everything again on each continuation repeats more and more content; keeping only a summary can make the original basis of a decision difficult to recover.

+

Selective JSON Pointer lookup by itself is straightforward—it folds long-tail history not needed for the immediate decision. The core mechanism in LoopX's context delivery is compaction-cycle-bounded structured delta context: complete sources are saved first, unchanged typed subtrees are reused exactly against a verified baseline within the active context_epoch, and any host compaction or digest mismatch atomically resets to a fresh complete baseline rather than chaining dangling deltas.

+

Results first: four-stage step-down, compaction-cycle deltas and task ablation

+

Step-down from 100%: All → Progressive → Compaction-Cycle Structured Delta → First Read

+

When stacked in pipeline order, context payload bytes step down monotonically from 100% complete capture (All) to the Progressive necessary view, then to compaction-cycle structured delta on top of Progressive (Progressive + Delta), and finally to the byte-budgeted --initial-read entrypoint (Progressive + Delta First Read):

+

Step-down from 100%: deterministic 4-stage pipeline and 18h compaction-cycle delta audit

Step-down from 100%: deterministic pipeline All 100% to Progressive 9.7% to Prog + In-cycle Delta 3.8% to First read 1.2%, paired with ANN 18h in-cycle delta reduction (-38.54% / -74.25%) and 8-task entry ratios
A: Same-source four-stage cascade from measurements.json (single 57,014 B denominator), where stacking compaction-cycle structured Delta cuts Progressive (9.7%) by a further 61.0% (to 3.8%) and first-read body reaches 1.2%. B1: ANN 18h paired trajectory stacking compaction-cycle structured Delta on selected packets (3.09 MB), cutting all 46 paired events by 38.54% and the 24 in-cycle delta wakes by 74.25%. B2: Eight-task cohort shares over 213 wakes (Progressive 32.5%) and 112 in-cycle continuations (Prog+Delta first-read 3.0% body / 5.0% CLI), each kept on its own denominator.
+

Eight tasks: single-layer payloads (Progressive / lossless Delta file) vs stacked first-read

+

When reading the published eight-task Four-Arm Context ON 18h table below, separate single-layer file payloads from the stacked first-read entrypoint. Across 213 model-facing wakes (101 new-session or post-compaction baseline reads and 112 in-cycle continuations), the published “In-cycle Delta payload” column (4.49 MB / ≈ 12.53 MB = 35.8%) measures the unprojected lossless delivery.json file on disk (All → Delta)—a parallel single-layer cut alongside “Progressive projection” (7.29 / 22.41 MB = 32.5%, All → Progressive), not stacked Progressive + Delta. Both mechanisms stack in the final column, Prog+Delta first-screen (3.0% body / 5.0% CLI). Per-task cells retain the published values; totals are recomputed from those cells without raw per-wake logs.

    -
  • Progressive reading: across all 213 wakes, full packets fall from 22.41 MB to 7.29 MB (−67.5%). The projection retains 32.5% of original bytes, with a per-task range of 26.5%–39.0%; unselected candidates and historical detail remain available on demand.
  • -
  • In-cycle deltas: across 112 continuations, corresponding full packets fall from approximately 12.53 MB to 4.49 MB (−64.2%). Deltas retain 35.8% of same-wake full bytes, with a per-task range of 20.7%–47.1%.
  • -
  • Progressive + delta first read: for those same 112 continuations, the --initial-read body carries 3.0% of original bytes, or 5.0% including the CLI JSON envelope (−97.0% / −95.0%). First-read size is not whole-episode model input.
  • +
  • Single-layer progressive view (All → Progressive): across all 213 wakes, full packets fall from 22.41 MB to 7.29 MB (−67.5%), retaining 32.5% of original bytes (26.5%–39.0% per task) while keeping unselected candidates and historical detail expandable on demand.
  • +
  • Single-layer lossless delta file (All → Delta): across 112 continuations, unprojected lossless delta files fall from approximately 12.53 MB to 4.49 MB (−64.2%), retaining 35.8% of same-wake full bytes (20.7%–47.1% per task).
  • +
  • Stacked entrypoint (Progressive + Delta First Read): for those same 112 continuations, stacking progressive selection with compaction-cycle deltas brings the --initial-read body to 3.0% of original bytes, or 5.0% including the CLI JSON envelope (−97.0% / −95.0%). First-read size is not whole-episode model input.
-

8-task Four-Arm Context ON byte ratios (N = 213 wakes, 112 in-cycle Deltas)

8-Task Four-Arm Context ON 18h Control-Plane Byte Share: Progressive 32.5% (-67.5%), In-Cycle Delta 35.8% (-64.2%), Prog+Delta First-Screen 3.0% / 5.0%
A: Per-task shares, with Progressive over all wakes and Delta/first-read over in-cycle wakes only. B: Separate cohort totals: Progressive 7.29 / 22.41 MB over 213 wakes; Delta 4.49 / approximately 12.53 MB over 112 wakes. First-read body / CLI totals are 0.374 / 0.631 MB for the same 112 wakes. The two denominators are not interchangeable. Open image for full size.
+

8-task Four-Arm Context ON byte audit (N = 213 wakes, 112 in-cycle continuations)

8-Task Four-Arm Context ON 18h Control-Plane Byte Audit: All 100% vs Lossless Delta File 35.8%, Progressive View 32.5%, and Stacked Prog+Delta First-Read 3.0% / 5.0%
A: Per-task shares comparing the two single-layer payloads (Progressive over all 213 wakes; lossless Delta file over 112 continuations) against the stacked first-read body. B: Cohort totals anchored at 100% Full: lossless Delta file ≈ 35.8% (4.49 / ≈ 12.53 MB), Progressive view 32.5% (7.29 / 22.41 MB), and stacked Prog+Delta first-read ≈ 5.0% (CLI) / ≈ 3.0% (body). The two denominators are not interchangeable.
Expand the eight-task data table
diff --git a/apps/presentation/site/public/blog/images/context-delivery/context-cascade-en.svg b/apps/presentation/site/public/blog/images/context-delivery/context-cascade-en.svg new file mode 100644 index 0000000000..f3df3df230 --- /dev/null +++ b/apps/presentation/site/public/blog/images/context-delivery/context-cascade-en.svg @@ -0,0 +1,447 @@ + + + + + + + + image/svg+xml + + + Matplotlib v3.11.2, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + 25 + + + + + + + + + 50 + + + + + + + + + 75 + + + + + + + + + 100 + + + + Share of complete source bytes (%) + + + + + + + 1. All · Full source + + + + + + 2. Progressive · Fold tail + + + + + + 3. Prog + In-cycle Delta + + + + + + 4. Prog + Delta First read + + + + + + + + + + + + + + + + + 100.0% (57,014 B) + + + 9.7% (5,543 B · fold long tail) + + + 3.8% (2,164 B · −61.0% vs Prog) + + + 1.2% (674 B body / 2.4% CLI) + + + A. Same-source 4-stage cascade + + + + + + + + + + + + + + 0 + + + + + + + + + 25 + + + + + + + + + 50 + + + + + + + + + 75 + + + + + + + + + 100 + + + + Share of Progressive selected bytes (%) + + + + + + + Progressive selected (46) + + + + + + + In-cycle Delta (all 46) + + + + + + + In-cycle Delta (24 delta) + + + + + + + + + + + + + + 100.0% (3.09 MB selected base) + + + 61.5% (1.90 MB · −38.54%) + + + 25.75% (in-cycle −74.25%) + + + B1. 18h core layer: stacking compaction-cycle Delta (ANN) + + + + + + + + + + + + + + 0 + + + + + + + + + 25 + + + + + + + + + 50 + + + + + + + + + 75 + + + + + + + + + 100 + + + + Share of cohort Full bytes (%) + + + + + + + All · Full packets + + + + + + Progressive · 213 wakes + + + + + + Prog+Delta First read · 112 + + + + + + + + + + + + + + 100.0% (22.41 MB / in-cycle ≈12.53 MB) + + + 32.5% (7.29 MB · −67.5%) + + + ≈ 3.0% body / ≈ 5.0% CLI (−97% / −95%) + + + B2. 8-task 18h cohorts: 100% Full to Prog+Delta entry + + + + Step-Down from 100%: All → Progressive → Compaction-Cycle Structured Delta → First Read + + + Progressive lookup folds long-tail history; the core mechanism reuses verified subtrees within a compaction epoch and resets on compaction. + + + A: exact same-source pipeline (measurements.json, single 57,014 B denominator). B1: ANN 18h paired trajectory stacking compaction-cycle Delta on selected packets. + B2: 8-task shares over 213 wakes (Progressive) and 112 in-cycle continuations (Prog+Delta first-read); each cohort keeps its own denominator. + + + + + + + + + + + + + + diff --git a/apps/presentation/site/public/blog/images/context-delivery/context-cascade-zh.svg b/apps/presentation/site/public/blog/images/context-delivery/context-cascade-zh.svg new file mode 100644 index 0000000000..264323ee54 --- /dev/null +++ b/apps/presentation/site/public/blog/images/context-delivery/context-cascade-zh.svg @@ -0,0 +1,447 @@ + + + + + + + + image/svg+xml + + + Matplotlib v3.11.2, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + 25 + + + + + + + + + 50 + + + + + + + + + 75 + + + + + + + + + 100 + + + + 占完整原始捕获字节 (%) + + + + + + + 1. All · 完整上下文 + + + + + + 2. Progressive · 渐进折叠 + + + + + + 3. Prog + 周期内结构化 Delta + + + + + + 4. Prog + Delta First Read + + + + + + + + + + + + + + + + + 100.0% (57,014 B) + + + 9.7% (5,543 B · 按需折叠长尾) + + + 3.8% (2,164 B · 较 Prog 再减 −61.0%) + + + 1.2% (674 B 正文 / 2.4% CLI) + + + A. 同源流水线四阶叠加削减(固定基准) + + + + + + + + + + + + + + 0 + + + + + + + + + 25 + + + + + + + + + 50 + + + + + + + + + 75 + + + + + + + + + 100 + + + + 占 Progressive 选中字节 (%) + + + + + + + Progressive 选中包 (46 轮) + + + + + + + 周期内 Delta (全 46 轮) + + + + + + + 周期内 Delta (24 增量轮) + + + + + + + + + + + + + + 100.0% (3.09 MB 选中基线) + + + 61.5% (1.90 MB · 再减 −38.54%) + + + 25.75% (同周期再减 −74.25%) + + + B1. 18h 实测核心增量:叠加压缩周期内结构化 Delta(ANN) + + + + + + + + + + + + + + 0 + + + + + + + + + 25 + + + + + + + + + 50 + + + + + + + + + 75 + + + + + + + + + 100 + + + + 占对应唤醒组 Full 字节 (%) + + + + + + + All · 完整决策包 + + + + + + Progressive · 213 次 + + + + + + Prog+Delta 首读 · 112 次 + + + + + + + + + + + + + + 100.0% (22.41 MB / 续跑 ≈12.53 MB) + + + 32.5% (7.29 MB · 净减 −67.5%) + + + ≈ 3.0% 正文 / ≈ 5.0% CLI (−97% / −95%) + + + B2. 八题 18h 队列汇总:从 100% 到叠加首读入口 + + + + 从 100% 逐层削减:All → Progressive → 压缩周期内结构化 Delta → First Read + + + 渐进选读仅按需折叠历史长尾;核心机制是在有效 Compaction 周期内精确复用不变结构子树,并在压缩或失配时原子恢复完整基线。 + + + A:同源固定流水线(measurements.json,同一 57,014 B 分母)。B1:ANN 18h 配对轨迹在选中包(3.09 MB)上叠加周期内结构化 Delta 的进一步削减。 + B2:八题 213 次唤醒(Progressive)与 112 次同周期续跑(Prog+Delta 首读)各自相对原分母的比例;跨队列分母分开列出,不做混乘。 + + + + + + + + + + + + + + diff --git a/apps/presentation/site/public/blog/images/context-delivery/multitask-byte-ratios-en.svg b/apps/presentation/site/public/blog/images/context-delivery/multitask-byte-ratios-en.svg index cc9760a749..43dacc06c3 100644 --- a/apps/presentation/site/public/blog/images/context-delivery/multitask-byte-ratios-en.svg +++ b/apps/presentation/site/public/blog/images/context-delivery/multitask-byte-ratios-en.svg @@ -1,7 +1,7 @@ - + @@ -21,538 +21,544 @@ - - + - 0 + 0 - + - 10 + 10 - + - 20 + 20 - + - 30 + 30 - + - 40 + 40 - + - 50 + 50 - Share of Full bytes within each cohort (%) + Share of Full bytes within each cohort (%) - Grid Robot + Grid Robot - VLIW Scheduling + VLIW Scheduling - FFmpeg Encoding + FFmpeg Encoding - OpenTTD Transport + OpenTTD Transport - Ad Placement + Ad Placement - Borden Inversion + Borden Inversion - Rust Workspace + Rust Workspace - ANN Vector Search + ANN Vector Search - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - A. Task shares · cohorts stay explicit + A. Per-task shares · single-layer vs stacked - - + - 0 + 0 - + - 10 + 25 - + - 20 + 50 - + - 30 + 75 - + - 40 - - - - - - - - - 50 + 100 - - - Progressive · 213 + + + All (Full) · 213 / 112 - - - Delta · 112 + + + Delta file only · 112 - - - First body · 112 + + + Progressive view · 213 - + + + Prog+Delta First CLI · 112 + + + + - First CLI · 112 + Prog+Delta First body · 112 - +" clip-path="url(#p31b26ab10d)" style="fill: #334155"/> - +" clip-path="url(#p31b26ab10d)" style="fill: #0f766e"/> - +" clip-path="url(#p31b26ab10d)" style="fill: #2563eb"/> - +" clip-path="url(#p31b26ab10d)" style="fill: #64748b"/> + + + - 32.5% + 100.0% - ≈ 35.8% + ≈ 35.8% - ≈ 3.0% + 32.5% - ≈ 5.0% + ≈ 5.0% - B. Weighted totals · separate denominators + ≈ 3.0% + + + B. From 100%: single-layer vs stacked entry - - - Eight-task context byte audit: 213 wakes and 112 in-cycle wakes - Progressive: 7,285,951 / 22,408,690 B across 213 wakes. Delta/first-read: 112 wakes; reported Full denominator ≈ 12.53 MB. - Aggregate recalculation; exact per-wake denominators unavailable. The right panel is not a cumulative reduction across 213 wakes. + Eight-task context byte audit: single-layer payloads vs stacked Prog+Delta entry + + + All: 22,408,690 B (213 wakes) / ≈ 12.53 MB (112 continuations). Published 'Delta file only' (4,488,335 B ≈ 35.8%) is the unprojected lossless delta file, + parallel to Progressive (7,285,951 B = 32.5%); stacking both in Prog+Delta first-read drops the entry payload to ≈ 3.0% (body) / ≈ 5.0% (CLI). - - + - - Progressive · all wakes + + Progressive · all 213 wakes - - + - - Delta · in-cycle + + Lossless Delta file · 112 wakes - - + - - First-read body · in-cycle + + Prog+Delta First body · 112 wakes - - + + - - + + diff --git a/apps/presentation/site/public/blog/images/context-delivery/multitask-byte-ratios-zh.svg b/apps/presentation/site/public/blog/images/context-delivery/multitask-byte-ratios-zh.svg index ca40269534..18989bcba8 100644 --- a/apps/presentation/site/public/blog/images/context-delivery/multitask-byte-ratios-zh.svg +++ b/apps/presentation/site/public/blog/images/context-delivery/multitask-byte-ratios-zh.svg @@ -1,7 +1,7 @@ - + @@ -21,538 +21,544 @@ - - + - 0 + 0 - + - 10 + 10 - + - 20 + 20 - + - 30 + 30 - + - 40 + 40 - + - 50 + 50 - 占同组 Full 字节 (%) + 占同组 Full 字节 (%) - Grid Robot + Grid Robot - VLIW Scheduling + VLIW Scheduling - FFmpeg Encoding + FFmpeg Encoding - OpenTTD Transport + OpenTTD Transport - Ad Placement + Ad Placement - Borden Inversion + Borden Inversion - Rust Workspace + Rust Workspace - ANN Vector Search + ANN Vector Search - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #2563eb"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #0f766e"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - +" clip-path="url(#pbd0f859176)" style="fill: #7c3aed"/> - A. 逐题占比 · 分开标明唤醒组 + A. 逐题占比 · 单层文件载荷与叠加首读 - - + - 0 + 0 - + - 10 + 25 - + - 20 + 50 - + - 30 + 75 - + - 40 - - - - - - - - - 50 + 100 - - - Progressive · 213 + + + All (Full) · 213 / 112 - - - Delta · 112 + + + 单路 Delta 文件 · 112 - - - First body · 112 + + + Progressive 视图 · 213 - + + + Prog+Delta 首读 CLI · 112 + + + + - First CLI · 112 + Prog+Delta 首读正文 · 112 - +" clip-path="url(#p31b26ab10d)" style="fill: #334155"/> - +" clip-path="url(#p31b26ab10d)" style="fill: #0f766e"/> - +" clip-path="url(#p31b26ab10d)" style="fill: #2563eb"/> - +" clip-path="url(#p31b26ab10d)" style="fill: #64748b"/> + + + - 32.5% + 100.0% - ≈ 35.8% + ≈ 35.8% - ≈ 3.0% + 32.5% - ≈ 5.0% + ≈ 5.0% - B. 各自分母的加权总计 + ≈ 3.0% + + + B. 从 100% 对照单层载荷与叠加首读 - - - 八题上下文字节审计:先区分 213 次与 112 次唤醒 - Progressive:7,285,951 / 22,408,690 B,覆盖 213 次唤醒。Delta/首读:仅覆盖 112 次,Full 分母原报告约 12.53 MB。 - 聚合复算;原始逐 wake 分母未公开。不可将右图解释为覆盖 213 次的累积减量。 + 八题上下文字节审计:区分单层载荷(Progressive / 无损 Delta)与叠加首读 + + + All:22,408,690 B(213 次)/ 约 12.53 MB(112 次续跑)。归档表中「单路 Delta 文件」(4,488,335 B ≈ 35.8%)是未叠加渐进裁剪的完整无损差分文件, + 与 Progressive(7,285,951 B = 32.5%)同属单层裁剪;两者叠加后的 Prog+Delta 首读入口降至 ≈ 3.0%(正文)/ ≈ 5.0%(含 CLI 封装)。 - - + - - Progressive · all wakes + + Progressive · 全部 213 次 - - + - - Delta · in-cycle + + 单路无损 Delta 文件 · 112 次 - - + - - First-read body · in-cycle + + Prog+Delta 首读正文 · 112 次 - - + + - - + + diff --git a/apps/presentation/site/public/blog/index.html b/apps/presentation/site/public/blog/index.html index 4034183798..cb8bef8477 100644 --- a/apps/presentation/site/public/blog/index.html +++ b/apps/presentation/site/public/blog/index.html @@ -35,8 +35,8 @@

LoopX · Blog

Engineering the long run.

Design, engineering, and field notes on long-horizon agents.

-

Context delivery · Mechanisms and examples

· Updated November 10

-

An Agent needs a way to look things up, too

Recalculate eight published task rows: Progressive is 32.5% over 213 wakes; in-cycle Delta is approximately 35.8% over a separate 112-wake cohort. Preserve complete reads, recovery and evidence boundaries.

Read article
+

Context delivery · Mechanisms and examples

· Updated November 12

+

An Agent needs a way to look things up, too

Step down from 100% saved context: fold long-tail history (32.5% across 213 wakes), stack compaction-cycle structured deltas (−74.25% on ANN in-cycle wakes; ≈ 3.0% / 5.0% 8-task first-read entry), and reset cleanly on compaction.

Read article

Research notes · EdgeBench and LHTB

diff --git a/apps/presentation/site/public/blog/zh/context-delivery/index.html b/apps/presentation/site/public/blog/zh/context-delivery/index.html index 85af793ab2..80af5c8898 100644 --- a/apps/presentation/site/public/blog/zh/context-delivery/index.html +++ b/apps/presentation/site/public/blog/zh/context-delivery/index.html @@ -6,18 +6,21 @@ -
← 全部文章

Context delivery

Agent 读上下文,也需要一套“查书”的方法

沿一个语音任务,讲清选读、完整首读、按阶段补读、精确复用与恢复。

-

Agent 做长任务,资料会越来越多:原目标、后来追加的约束、试过的方案、失败的实验、当前做到哪里。每次继续都把整份材料再塞一遍,重复会不断累积;只留一段摘要,又可能找不回决定所依赖的原话。

-

LoopX 的 context delivery 把这件事拆开做:完整资料保存下来,当前决定需要的事实先读,支持材料沿问题展开;同一个有效 compaction 周期内,再精确复用没有变化的结构。

-

先看数据:渐进读取、差分交付与任务消融

-

八题对照:渐进读取与周期差分

-

本节复算已公开的八题四臂 Context ON 18h 聚合表,以区分 Progressive 与周期内 Delta 的传输开销。原表报告 213 次模型侧唤醒:101 次新会话或压缩后的基线读取,以及 112 次周期内续跑。逐题单元格保留来源原值,合计按表重算;这里不附原始逐 wake 日志。

+
← 全部文章

Context delivery

Agent 读上下文,也需要一套“查书”的方法

从 100% 全量捕获逐层削减:按需渐进折叠长尾,在有效 compaction 周期内交付结构化差分上下文,并在压缩后无损恢复基线。

+

Agent 做长任务,资料会越来越多:原目标、后来追加的约束、试过的方案、失败的实验、当前做到哪里。每次继续都把整份材料再塞一遍,重复会不断累积;只留一段摘要,又可能找不回决定所依赖的原话。

+

按 JSON Pointer 渐进选读本身并不复杂,主要用来折叠当前决定暂不需要的历史长尾;LoopX 上下文交付真正的机制重心,是受 compaction 周期约束的结构化差分上下文(compaction-cycle structured delta):完整来源先落盘存证,在同一个已核验的 context_epoch 内精确复用未变化的结构子树、只编码本轮结构增删改;一旦宿主发生上下文压缩或基线摘要失配,立即原子切换回新的完整基线,绝不悬空叠加旧差分。

+

先看数据:从 100% 逐层削减、周期内结构化差分与任务消融

+

四阶叠加流水线:All → Progressive → 压缩周期内结构化 Delta → First Read

+

按实际叠加顺序看,上下文体积沿着四级流水线单调递减:先从 100% 完整捕获(All)折叠长尾得到 Progressive 必要视图,再在同一有效 compaction 周期内叠加结构化差分(Progressive + Delta),最后以受字节预算保护的 --initial-read 首读入口(Progressive + Delta First Read)送达当前轮起始事实:

+

从 100% 逐层削减:同源四阶流水线与 18h 轨迹周期内差分实测

从 100% 逐层削减:同源流水线 All 100% → Progressive 9.7% → Prog+周期内Delta 3.8% → 首读 1.2%,以及 ANN 18h 周期内结构化差分再减 38.54% / 74.25% 与八题首读阶梯
A:后文同源固定流水线(measurements.json,同一 57,014 B 分母)的四阶单调削减,在 Progressive(9.7%)之上叠加周期内结构化 Delta 再减 61.0%(至 3.8%),首读正文降至 1.2%。B1:ANN 18h 配对轨迹在 Progressive 选中包(3.09 MB)上叠加周期内结构化 Delta,全 46 轮再减 38.54%,24 个同周期增量轮再减 74.25%。B2:八题 213 次唤醒(Progressive 32.5%)与 112 次同周期续跑(Prog+Delta 首读正文 3.0% / CLI 5.0%)各自相对原分母的比例。
+

八题对照:区分单层载荷(Progressive / 无损 Delta 文件)与叠加首读

+

阅读下方已公开的八题四臂 Context ON 18h 聚合表时,需要区分单层文件载荷与双层叠加首读:原表共覆盖 213 次模型侧唤醒(101 次新会话或压缩后的基线读取 + 112 次同周期续跑),其中「同周期 Delta 载荷」列(4.49 MB / 约 12.53 MB = 35.8%)统计的是磁盘上尚未叠加渐进裁剪的单路无损 delivery.json 文件(All → Delta),与「Progressive 必要视图」(7.29 / 22.41 MB = 32.5%,All → Progressive)属于平行的单层裁剪,而非叠加后的 Progressive + Delta;把渐进选读与周期内差分真正叠在一起的,是最后一列 Prog+Delta 首读入口(3.0% 正文 / 5.0% 含 CLI 封装)。逐题单元格保留来源原值,合计按表重算;这里不附原始逐 wake 日志。

    -
  • 渐进读取:全部 213 次唤醒,完整包 22.41 MB → 7.29 MB(−67.5%)。投影保留原包的 32.5%,各题为 26.5%–39.0%;未选中候选与历史长尾详情按需展开。
  • -
  • 周期内差分:112 次同周期续跑,对应完整包 约 12.53 MB → 4.49 MB(−64.2%)。差分保留同组原包的 35.8%,各题为 20.7%–47.1%。
  • -
  • 渐进+差分首读:在同一组 112 次续跑中,--initial-read 正文占原包 3.0%,含 CLI JSON 封装为 5.0%(净减 −97.0% / −95.0%)。首读入口大小不代表整轮模型输入。
  • +
  • 单层渐进视图(All → Progressive):全部 213 次唤醒,完整包 22.41 MB → 7.29 MB(−67.5%),保留原包的 32.5%(各题 26.5%–39.0%);未选中候选与历史长尾按需展开。
  • +
  • 单层无损差分文件(All → Delta):112 次同周期续跑,未裁剪的完整无损差分文件对应同轮完整包 约 12.53 MB → 4.49 MB(−64.2%),占同组原包 35.8%(各题 20.7%–47.1%)。
  • +
  • 叠加首读入口(Progressive + Delta First Read):在同一组 112 次续跑中,叠加渐进选读与周期差分后的 --initial-read 正文占原包 3.0%,含 CLI JSON 封装为 5.0%(净减 −97.0% / −95.0%)。首读入口大小不代表整轮模型输入。
-

八题四臂 Context ON 控制面字节比例(N = 213 唤醒,112 周期内 Delta)

八题四臂 Context ON 18h 轨迹控制面字节比例:Progressive 占 32.5% (-67.5%),同周期 Delta 占 35.8% (-64.2%),Prog+Delta 首屏占 3.0% / 5.0%
A:逐题占比,Progressive 覆盖全部唤醒,Delta/首读仅覆盖周期内唤醒。B:分开汇总:213 次唤醒的 Progressive 为 7.29 / 22.41 MB;112 次周期内唤醒的 Delta 为 4.49 / 约 12.53 MB。同一 112 次的首读正文/CLI 为 0.374 / 0.631 MB。两个分母不可混用。可打开原图查看。
+

八题四臂 Context ON 控制面字节审计(N = 213 唤醒,112 周期内续跑)

八题四臂 Context ON 18h 轨迹控制面字节比例:从 All 100% 对照单路无损 Delta 文件 35.8%、Progressive 视图 32.5% 与叠加后的 Prog+Delta 首读 3.0% / 5.0%
A:逐题占比,对比两条单层载荷(Progressive 覆盖全部 213 次唤醒,单路无损 Delta 文件覆盖 112 次续跑)与叠加后的首读正文。B:以 100% Full 为基准分开汇总:单路无损 Delta 文件约 35.8%(4.49 / 约 12.53 MB),Progressive 视图 32.5%(7.29 / 22.41 MB),两者叠加后的 Prog+Delta 首读入口降至约 5.0%(CLI)/ 3.0%(正文)。两个队列分母不可混用。
展开八题逐项数据
diff --git a/apps/presentation/site/public/blog/zh/index.html b/apps/presentation/site/public/blog/zh/index.html index 89527d32d0..55a6c22d95 100644 --- a/apps/presentation/site/public/blog/zh/index.html +++ b/apps/presentation/site/public/blog/zh/index.html @@ -35,8 +35,8 @@

LoopX · 博客

长程工作的工程实践。

关于长程 Agent 的设计、工程与实践。

-

Context delivery · 机制与实例

· 11 月 8 日更新

-

Agent 读上下文,也需要一套“查书”的方法

八题公开表复算:213 次唤醒的 Progressive 为 32.5%;112 次周期内 Delta 约 35.8%,两者采用不同分母。保留完整读取、恢复及证据边界。

阅读全文
+

Context delivery · 机制与实例

· 11 月 12 日更新

+

Agent 读上下文,也需要一套“查书”的方法

从 100% 完整捕获逐层削减:按需渐进折叠长尾(213 次唤醒保留 32.5%),在有效 compaction 周期内叠加结构化差分(ANN 增量轮再减 74.25%,八题首读入口降至约 3.0% / 5.0%),压缩或失配即原子恢复完整基线。

阅读全文

研究札记 · EdgeBench 与 LHTB

diff --git a/apps/presentation/site/scripts/generate-long-horizon-audit.py b/apps/presentation/site/scripts/generate-long-horizon-audit.py index 52de0edd71..f023d79692 100644 --- a/apps/presentation/site/scripts/generate-long-horizon-audit.py +++ b/apps/presentation/site/scripts/generate-long-horizon-audit.py @@ -13,11 +13,14 @@ BLOG = Path(__file__).resolve().parents[1] / "public/blog" DATA = json.loads((BLOG / "data/long-horizon-audit.json").read_text()) +LESSON = json.loads((BLOG / "context-delivery/measurements.json").read_text()) mpl.rcParams.update({"svg.fonttype": "none", "svg.hashsalt": "loopx-blog-audit", "font.family": "sans-serif", "font.sans-serif": ["PingFang SC", "Noto Sans CJK SC", "DejaVu Sans"], "axes.spines.top": False, "axes.spines.right": False, "axes.spines.left": False, "axes.spines.bottom": False, "axes.labelcolor": "#334155", "text.color": "#0f172a"}) -BLUE, TEAL, PURPLE, GRAY = "#2563eb", "#0f766e", "#7c3aed", "#94a3b8" +SLATE, BLUE, TEAL, EMERALD, INDIGO, PURPLE, GRAY = ( + "#334155", "#2563eb", "#0f766e", "#059669", "#4f46e5", "#7c3aed", "#64748b" +) def save(fig, relative): @@ -29,13 +32,200 @@ def save(fig, relative): for language in ("en", "zh"): zh = language == "zh" + # 1. Four-stage monotonic step-down cascade: + # All (100%) -> Progressive -> Progressive + Compaction-Cycle Structured Delta -> First Read + orig_b = LESSON["native_projection"]["original_bytes"] + prog_b = LESSON["cycle_codec"]["current_full_bytes"] + pdelta_b = LESSON["cycle_codec"]["delta_bytes"] + batch_row = next(r for r in LESSON["reader_rows"] if r["case"] == "one_batched_select") + first_body_lesson = batch_row["body_bytes"] + first_cli_lesson = batch_row["output_bytes"] + + fig = plt.figure(figsize=(14.4, 6.9)) + gs = fig.add_gridspec( + 2, 2, width_ratios=[1.05, 1.15], height_ratios=[1.0, 1.0], + left=.18, right=.97, bottom=.20, top=.78, wspace=.48, hspace=.58, + ) + left = fig.add_subplot(gs[:, 0]) + right_top = fig.add_subplot(gs[0, 1]) + right_bot = fig.add_subplot(gs[1, 1]) + + cascade_vals = [100.0, 100 * prog_b / orig_b, 100 * pdelta_b / orig_b, 100 * first_body_lesson / orig_b] + cascade_labels = ( + [ + "1. All · 完整上下文", + "2. Progressive · 渐进折叠", + "3. Prog + 周期内结构化 Delta", + "4. Prog + Delta First Read", + ] + if zh else + [ + "1. All · Full source", + "2. Progressive · Fold tail", + "3. Prog + In-cycle Delta", + "4. Prog + Delta First read", + ] + ) + cascade_notes = ( + [ + f"100.0% ({orig_b:,} B)", + f"{cascade_vals[1]:.1f}% ({prog_b:,} B · 按需折叠长尾)", + f"{cascade_vals[2]:.1f}% ({pdelta_b:,} B · 较 Prog 再减 −61.0%)", + f"{cascade_vals[3]:.1f}% ({first_body_lesson:,} B 正文 / {100*first_cli_lesson/orig_b:.1f}% CLI)", + ] + if zh else + [ + f"100.0% ({orig_b:,} B)", + f"{cascade_vals[1]:.1f}% ({prog_b:,} B · fold long tail)", + f"{cascade_vals[2]:.1f}% ({pdelta_b:,} B · −61.0% vs Prog)", + f"{cascade_vals[3]:.1f}% ({first_body_lesson:,} B body / {100*first_cli_lesson/orig_b:.1f}% CLI)", + ] + ) + left.barh(range(4), cascade_vals, color=[SLATE, BLUE, TEAL, PURPLE], height=.50) + left.set_yticks(range(4), cascade_labels, fontsize=10.2) + left.invert_yaxis() + left.set_xlim(0, 168) + left.set_xlabel("占完整原始捕获字节 (%)" if zh else "Share of complete source bytes (%)", fontsize=9.8) + left.set_title( + "A. 同源流水线四阶叠加削减(固定基准)" if zh else "A. Same-source 4-stage cascade", + loc="left", pad=14, fontsize=11.5, fontweight="bold", + ) + for idx, (val, note) in enumerate(zip(cascade_vals, cascade_notes)): + weight = "bold" if idx == 2 else "normal" + color = "#0f766e" if idx == 2 else "#0f172a" + left.text(val + 2.2, idx, note, va="center", fontsize=9.6, fontweight=weight, color=color) + + # Panel B1: Real 18h ANN paired audit — stacking Compaction-Cycle Structured Delta on top of Progressive + ann_prog_b = 3089841 + ann_all46_b = 1898889 + ann_vals = [100.0, 100 * ann_all46_b / ann_prog_b, 100.0 - 74.25] + ann_labels = ( + [ + "Progressive 选中包 (46 轮)", + "+ 周期内 Delta (全 46 轮)", + "+ 周期内 Delta (24 增量轮)", + ] + if zh else + [ + "Progressive selected (46)", + "+ In-cycle Delta (all 46)", + "+ In-cycle Delta (24 delta)", + ] + ) + ann_notes = ( + [ + "100.0% (3.09 MB 选中基线)", + f"{ann_vals[1]:.1f}% (1.90 MB · 再减 −38.54%)", + f"{ann_vals[2]:.2f}% (同周期再减 −74.25%)", + ] + if zh else + [ + "100.0% (3.09 MB selected base)", + f"{ann_vals[1]:.1f}% (1.90 MB · −38.54%)", + f"{ann_vals[2]:.2f}% (in-cycle −74.25%)", + ] + ) + right_top.barh(range(3), ann_vals, color=[BLUE, TEAL, EMERALD], height=.52) + right_top.set_yticks(range(3), ann_labels, fontsize=9.8) + right_top.invert_yaxis() + right_top.set_xlim(0, 188) + right_top.set_xlabel("占 Progressive 选中字节 (%)" if zh else "Share of Progressive selected bytes (%)", fontsize=9.5) + right_top.set_title( + "B1. 18h 实测核心增量:叠加压缩周期内结构化 Delta(ANN)" + if zh else + "B1. 18h core layer: stacking compaction-cycle Delta (ANN)", + loc="left", pad=12, fontsize=11.0, fontweight="bold", + ) + for idx, (val, note) in enumerate(zip(ann_vals, ann_notes)): + weight = "bold" if idx >= 1 else "normal" + color = "#0f766e" if idx >= 1 else "#0f172a" + right_top.text(val + 2.4, idx, note, va="center", fontsize=9.4, fontweight=weight, color=color) + + # Panel B2: 8-task 18h aggregate step-down (explicit cohorts) + rows = DATA["context"]["tasks"] + prog_213 = 100 * sum(r["progressive_bytes"] for r in rows) / sum(r["full_bytes"] for r in rows) + denom_112 = DATA["context"]["delta_full_bytes_reported_approx"] + first_cli_112 = 100 * sum(r["first_cli_bytes"] for r in rows) / denom_112 + first_body_112 = 100 * sum(r["first_body_bytes"] for r in rows) / denom_112 + real_vals = [100.0, prog_213, first_body_112] + real_labels = ( + [ + "All · 完整决策包", + "Progressive · 213 次", + "Prog+Delta 首读 · 112 次", + ] + if zh else + [ + "All · Full packets", + "Progressive · 213 wakes", + "Prog+Delta First read · 112", + ] + ) + real_notes = ( + [ + "100.0% (22.41 MB / 续跑 ≈12.53 MB)", + f"{prog_213:.1f}% (7.29 MB · 净减 −67.5%)", + f"≈ {first_body_112:.1f}% 正文 / ≈ {first_cli_112:.1f}% CLI (−97% / −95%)", + ] + if zh else + [ + "100.0% (22.41 MB / in-cycle ≈12.53 MB)", + f"{prog_213:.1f}% (7.29 MB · −67.5%)", + f"≈ {first_body_112:.1f}% body / ≈ {first_cli_112:.1f}% CLI (−97% / −95%)", + ] + ) + right_bot.barh(range(3), real_vals, color=[SLATE, BLUE, PURPLE], height=.52) + right_bot.set_yticks(range(3), real_labels, fontsize=9.8) + right_bot.invert_yaxis() + right_bot.set_xlim(0, 188) + right_bot.set_xlabel("占对应唤醒组 Full 字节 (%)" if zh else "Share of cohort Full bytes (%)", fontsize=9.5) + right_bot.set_title( + "B2. 八题 18h 队列汇总:从 100% 到叠加首读入口" + if zh else + "B2. 8-task 18h cohorts: 100% Full to Prog+Delta entry", + loc="left", pad=12, fontsize=11.0, fontweight="bold", + ) + for idx, (val, note) in enumerate(zip(real_vals, real_notes)): + right_bot.text(val + 2.4, idx, note, va="center", fontsize=9.4) + + for axis in (left, right_top, right_bot): + axis.set_axisbelow(True) + axis.grid(axis="x", color="#e2e8f0", linewidth=.7) + axis.tick_params(axis="both", length=0) + axis.set_xticks([0, 25, 50, 75, 100]) + + fig.suptitle( + "从 100% 逐层削减:All → Progressive → 压缩周期内结构化 Delta → First Read" + if zh else + "Step-Down from 100%: All → Progressive → Compaction-Cycle Structured Delta → First Read", + fontsize=15.0, fontweight="bold", y=.955, + ) + sub = ( + "渐进选读仅按需折叠历史长尾;核心机制是在有效 Compaction 周期内精确复用不变结构子树,并在压缩或失配时原子恢复完整基线。" + if zh else + "Progressive lookup folds long-tail history; the core mechanism reuses verified subtrees within a compaction epoch and resets on compaction." + ) + fig.text(.5, .87, sub, ha="center", fontsize=10.2, color="#475569") + footer_cascade = ( + "A:同源固定流水线(measurements.json,同一 57,014 B 分母)。B1:ANN 18h 配对轨迹在选中包(3.09 MB)上叠加周期内结构化 Delta 的进一步削减。\n" + "B2:八题 213 次唤醒(Progressive)与 112 次同周期续跑(Prog+Delta 首读)各自相对原分母的比例;跨队列分母分开列出,不做混乘。" + if zh else + "A: exact same-source pipeline (measurements.json, single 57,014 B denominator). B1: ANN 18h paired trajectory stacking compaction-cycle Delta on selected packets.\n" + "B2: 8-task shares over 213 wakes (Progressive) and 112 in-cycle continuations (Prog+Delta first-read); each cohort keeps its own denominator." + ) + fig.text(.03, .03, footer_cascade, fontsize=9.4, color="#475569", linespacing=1.5) + save(fig, f"images/context-delivery/context-cascade-{language}.svg") + + # 2. Eight-task detailed byte ratio audit (with 100% Full baseline bar & explicit single-layer vs stacked labels) rows = DATA["context"]["tasks"] - fig, axes = plt.subplots(1, 2, figsize=(13.8, 6.8), gridspec_kw={"width_ratios": [1.45, 1]}) - fig.subplots_adjust(left=.17, right=.97, bottom=.22, top=.80, wspace=.48) + fig, axes = plt.subplots(1, 2, figsize=(14.0, 6.8), gridspec_kw={"width_ratios": [1.38, 1.08]}) + fig.subplots_adjust(left=.15, right=.96, bottom=.23, top=.80, wspace=.50) left, right = axes - series = [("Progressive · all wakes", [100*r["progressive_bytes"]/r["full_bytes"] for r in rows], BLUE), - ("Delta · in-cycle", [r["delta_share_reported"] for r in rows], TEAL), - ("First-read body · in-cycle", [r["first_body_share_reported"] for r in rows], PURPLE)] + series = [ + ("Progressive · 全部 213 次" if zh else "Progressive · all 213 wakes", [100*r["progressive_bytes"]/r["full_bytes"] for r in rows], BLUE), + ("单路无损 Delta 文件 · 112 次" if zh else "Lossless Delta file · 112 wakes", [r["delta_share_reported"] for r in rows], TEAL), + ("Prog+Delta 首读正文 · 112 次" if zh else "Prog+Delta First body · 112 wakes", [r["first_body_share_reported"] for r in rows], PURPLE), + ] for index, (label, values, color) in enumerate(series): positions = [i + (index-1)*.23 for i in range(len(rows))] left.barh(positions, values, height=.20, label=label, color=color) @@ -43,28 +233,66 @@ def save(fig, relative): left.invert_yaxis() left.set_xlim(0, 55) left.set_xlabel("占同组 Full 字节 (%)" if zh else "Share of Full bytes within each cohort (%)") - left.set_title("A. 逐题占比 · 分开标明唤醒组" if zh else "A. Task shares · cohorts stay explicit", loc="left", pad=18) - totals = [100*sum(r["progressive_bytes"] for r in rows)/sum(r["full_bytes"] for r in rows)] + left.set_title( + "A. 逐题占比 · 单层文件载荷与叠加首读" if zh else "A. Per-task shares · single-layer vs stacked", + loc="left", pad=16, fontsize=11.5, fontweight="bold", + ) + + prog_share = 100 * sum(r["progressive_bytes"] for r in rows) / sum(r["full_bytes"] for r in rows) denominator = DATA["context"]["delta_full_bytes_reported_approx"] - totals += [100*sum(r[key] for r in rows)/denominator - for key in ("delta_bytes", "first_body_bytes", "first_cli_bytes")] - labels = ["Progressive · 213", "Delta · 112", "First body · 112", "First CLI · 112"] - right.barh(range(4), totals, color=[BLUE, TEAL, PURPLE, GRAY], height=.52) - right.set_yticks(range(4), labels, fontsize=10) + delta_share = 100 * sum(r["delta_bytes"] for r in rows) / denominator + first_cli_share = 100 * sum(r["first_cli_bytes"] for r in rows) / denominator + first_body_share = 100 * sum(r["first_body_bytes"] for r in rows) / denominator + + totals = [100.0, delta_share, prog_share, first_cli_share, first_body_share] + labels = ( + [ + "All (Full) · 213 / 112", + "单路 Delta 文件 · 112", + "Progressive 视图 · 213", + "Prog+Delta 首读 CLI · 112", + "Prog+Delta 首读正文 · 112", + ] + if zh else + [ + "All (Full) · 213 / 112", + "Delta file only · 112", + "Progressive view · 213", + "Prog+Delta First CLI · 112", + "Prog+Delta First body · 112", + ] + ) + right.barh(range(5), totals, color=[SLATE, TEAL, BLUE, GRAY, PURPLE], height=.54) + right.set_yticks(range(5), labels, fontsize=10) right.invert_yaxis() - right.set_xlim(0, 50) - for index, value in enumerate(totals): - right.text(value+1, index, f"{'≈ ' if index else ''}{value:.1f}%", va="center", fontsize=12) - right.set_title("B. 各自分母的加权总计" if zh else "B. Weighted totals · separate denominators", loc="left", pad=18) + right.set_xlim(0, 128) + right.set_xticks([0, 25, 50, 75, 100]) + approx_flags = [False, True, False, True, True] + for index, (value, approx) in enumerate(zip(totals, approx_flags)): + right.text(value + 2.0, index, f"{'≈ ' if approx else ''}{value:.1f}%", va="center", fontsize=10.5) + right.set_title( + "B. 从 100% 对照单层载荷与叠加首读" if zh else "B. From 100%: single-layer vs stacked entry", + loc="left", pad=16, fontsize=11.5, fontweight="bold", + ) for axis in axes: axis.set_axisbelow(True) axis.grid(axis="x", color="#e2e8f0", linewidth=.7) axis.tick_params(axis="both", length=0) - fig.suptitle("八题上下文字节审计:先区分 213 次与 112 次唤醒" if zh else "Eight-task context byte audit: 213 wakes and 112 in-cycle wakes", fontsize=17, y=.96) - fig.legend(*left.get_legend_handles_labels(), loc="lower center", ncol=3, frameon=False, bbox_to_anchor=(.53,.11), fontsize=10) - footer = ("Progressive:7,285,951 / 22,408,690 B,覆盖 213 次唤醒。Delta/首读:仅覆盖 112 次,Full 分母原报告约 12.53 MB。\n聚合复算;原始逐 wake 分母未公开。不可将右图解释为覆盖 213 次的累积减量。" if zh else - "Progressive: 7,285,951 / 22,408,690 B across 213 wakes. Delta/first-read: 112 wakes; reported Full denominator ≈ 12.53 MB.\nAggregate recalculation; exact per-wake denominators unavailable. The right panel is not a cumulative reduction across 213 wakes.") - fig.text(.03,.035,footer,fontsize=10,color="#475569",linespacing=1.6) + fig.suptitle( + "八题上下文字节审计:区分单层载荷(Progressive / 无损 Delta)与叠加首读" + if zh else + "Eight-task context byte audit: single-layer payloads vs stacked Prog+Delta entry", + fontsize=15.2, fontweight="bold", y=.955, + ) + fig.legend(*left.get_legend_handles_labels(), loc="lower center", ncol=3, frameon=False, bbox_to_anchor=(.50, .115), fontsize=9.8) + footer = ( + "All:22,408,690 B(213 次)/ 约 12.53 MB(112 次续跑)。归档表中「单路 Delta 文件」(4,488,335 B ≈ 35.8%)是未叠加渐进裁剪的完整无损差分文件,\n" + "与 Progressive(7,285,951 B = 32.5%)同属单层裁剪;两者叠加后的 Prog+Delta 首读入口降至 ≈ 3.0%(正文)/ ≈ 5.0%(含 CLI 封装)。" + if zh else + "All: 22,408,690 B (213 wakes) / ≈ 12.53 MB (112 continuations). Published 'Delta file only' (4,488,335 B ≈ 35.8%) is the unprojected lossless delta file,\n" + "parallel to Progressive (7,285,951 B = 32.5%); stacking both in Prog+Delta first-read drops the entry payload to ≈ 3.0% (body) / ≈ 5.0% (CLI)." + ) + fig.text(.03, .03, footer, fontsize=9.6, color="#475569", linespacing=1.55) save(fig, f"images/context-delivery/multitask-byte-ratios-{language}.svg") stride = DATA["stride"] diff --git a/examples/blog-bilingual-index-smoke.mjs b/examples/blog-bilingual-index-smoke.mjs index 123a5962b6..9f213617d9 100644 --- a/examples/blog-bilingual-index-smoke.mjs +++ b/examples/blog-bilingual-index-smoke.mjs @@ -107,6 +107,21 @@ export async function validateBilingualBlog(blogDir) { assertIncludes(article, `data-audit-progressive-bytes="${sum("progressive_bytes")}"`, "Both published editions must use the recomputed total"); assertIncludes(article, "32.5%", "The weighted share matches the public rows"); + const langSuffix = locale === "zh/" ? "zh" : "en"; + assertIncludes(article, `context-cascade-${langSuffix}.svg`, + "Both published editions must embed the 100% four-stage cascade chart"); + const cascadeSvg = await readFile( + resolve(blogDir, `images/context-delivery/context-cascade-${langSuffix}.svg`), + "utf8", + ); + for (const token of ["100.0%", "−61.0%", "−74.25%"]) { + assertIncludes(cascadeSvg, token, `Cascade chart must retain verified step-down figure: ${langSuffix} ${token}`); + } + const multitaskSvg = await readFile( + resolve(blogDir, `images/context-delivery/multitask-byte-ratios-${langSuffix}.svg`), + "utf8", + ); + assertIncludes(multitaskSvg, "100.0%", `Eight-task byte audit chart must anchor at 100% Full: ${langSuffix}`); if (/7,479,469|33\.4%|69\.9 KB|57\.1ms/.test(article)) throw new Error("Unreconciled totals or unsupported C1 attribution reappeared"); } From fee9a0f2e15c75c03a1f064563fc3620bd88b382 Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Thu, 12 Nov 2026 02:47:58 +0800 Subject: [PATCH 2/3] docs(blog): bind context comparisons to their actual baselines Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- .../public/blog/context-delivery/index.html | 10 +- .../context-delivery/context-cascade-en.svg | 205 ++++++++---------- .../context-delivery/context-cascade-zh.svg | 205 ++++++++---------- .../blog/zh/context-delivery/index.html | 10 +- .../scripts/generate-long-horizon-audit.py | 68 +++--- examples/blog-bilingual-index-smoke.mjs | 16 +- 6 files changed, 241 insertions(+), 273 deletions(-) diff --git a/apps/presentation/site/public/blog/context-delivery/index.html b/apps/presentation/site/public/blog/context-delivery/index.html index 6eed4a5428..c40a10cd00 100644 --- a/apps/presentation/site/public/blog/context-delivery/index.html +++ b/apps/presentation/site/public/blog/context-delivery/index.html @@ -6,13 +6,13 @@ -
← All articles

Context delivery

An Agent needs a way to look things up, too

Step down from 100% saved context: fold long-tail history on demand, reuse verified structures as compaction-cycle deltas, and reset cleanly on compaction.

-

Long-running work accumulates material: the original goal, later constraints, attempted routes, failed experiments and current progress. Sending everything again on each continuation repeats more and more content; keeping only a summary can make the original basis of a decision difficult to recover.

+
← All articles

Context delivery

An Agent needs a way to look things up, too

Read necessary facts first, reuse verified structures within a compaction cycle, and recover the complete baseline when continuity is lost.

+

Long-running work accumulates material: the original goal, later constraints, attempted routes, failed experiments and current progress. Sending everything again on each continuation repeats more and more content; keeping only a summary can make the original basis of a decision difficult to recover.

Selective JSON Pointer lookup by itself is straightforward—it folds long-tail history not needed for the immediate decision. The core mechanism in LoopX's context delivery is compaction-cycle-bounded structured delta context: complete sources are saved first, unchanged typed subtrees are reused exactly against a verified baseline within the active context_epoch, and any host compaction or digest mismatch atomically resets to a fresh complete baseline rather than chaining dangling deltas.

Results first: four-stage step-down, compaction-cycle deltas and task ablation

-

Step-down from 100%: All → Progressive → Compaction-Cycle Structured Delta → First Read

-

When stacked in pipeline order, context payload bytes step down monotonically from 100% complete capture (All) to the Progressive necessary view, then to compaction-cycle structured delta on top of Progressive (Progressive + Delta), and finally to the byte-budgeted --initial-read entrypoint (Progressive + Delta First Read):

-

Step-down from 100%: deterministic 4-stage pipeline and 18h compaction-cycle delta audit

Step-down from 100%: deterministic pipeline All 100% to Progressive 9.7% to Prog + In-cycle Delta 3.8% to First read 1.2%, paired with ANN 18h in-cycle delta reduction (-38.54% / -74.25%) and 8-task entry ratios
A: Same-source four-stage cascade from measurements.json (single 57,014 B denominator), where stacking compaction-cycle structured Delta cuts Progressive (9.7%) by a further 61.0% (to 3.8%) and first-read body reaches 1.2%. B1: ANN 18h paired trajectory stacking compaction-cycle structured Delta on selected packets (3.09 MB), cutting all 46 paired events by 38.54% and the 24 in-cycle delta wakes by 74.25%. B2: Eight-task cohort shares over 213 wakes (Progressive 32.5%) and 112 in-cycle continuations (Prog+Delta first-read 3.0% body / 5.0% CLI), each kept on its own denominator.
+

Four mechanisms, with separate measurement baselines

+

Complete capture, Progressive views, compaction-cycle structured Delta and a bounded --initial-read are composable mechanisms, but their bytes do not decrease monotonically for every input. Delta requires a verified same-cycle baseline; a new epoch, mismatch or smaller full representation uses complete delivery. The archived tutorial below measures three independent comparisons, not a same-source four-stage cascade.

+

Separate tutorial comparisons and 18h compaction-cycle Delta observations

Independent tutorial comparisons: Progressive view 5,107 / 57,014 B (9.0%); in-cycle Delta 2,164 / 5,543 B (39.0%); manual selection 674 / 51,547 B (1.3% body). ANN and eight-task archived cohorts retain separate baselines.
A: Three archived tutorial comparisons from measurements.json: the necessary view is 5,107 / 57,014 B (9.0%); the next capture's Delta file is 2,164 / 5,543 B of its full Progressive delivery file (39.0%); manually selecting three paths from the separate 51,547 B capture.json returns 674 B (1.3% body), or 1,362 B including CLI metadata (2.6%). The 674 B is not a measured --initial-read after Progressive + Delta. These saved observations belong to the revision recorded in measurements.json; output size may change with source revision and reader paths. B1: ANN's archived 18h pairs compare Delta against selected packets, with 38.54% reduction across 46 events and 74.25% across 24 in-cycle Delta events. B2: Eight-task aggregates retain the separate 213-wake and 112-continuation denominators; their percentages cannot be chained into this tutorial.

Eight tasks: single-layer payloads (Progressive / lossless Delta file) vs stacked first-read

When reading the published eight-task Four-Arm Context ON 18h table below, separate single-layer file payloads from the stacked first-read entrypoint. Across 213 model-facing wakes (101 new-session or post-compaction baseline reads and 112 in-cycle continuations), the published “In-cycle Delta payload” column (4.49 MB / ≈ 12.53 MB = 35.8%) measures the unprojected lossless delivery.json file on disk (All → Delta)—a parallel single-layer cut alongside “Progressive projection” (7.29 / 22.41 MB = 32.5%, All → Progressive), not stacked Progressive + Delta. Both mechanisms stack in the final column, Prog+Delta first-screen (3.0% body / 5.0% CLI). Per-task cells retain the published values; totals are recomputed from those cells without raw per-wake logs.

    diff --git a/apps/presentation/site/public/blog/images/context-delivery/context-cascade-en.svg b/apps/presentation/site/public/blog/images/context-delivery/context-cascade-en.svg index f3df3df230..c2594e7ec0 100644 --- a/apps/presentation/site/public/blog/images/context-delivery/context-cascade-en.svg +++ b/apps/presentation/site/public/blog/images/context-delivery/context-cascade-en.svg @@ -93,85 +93,68 @@ L 374.277959 109.296 - Share of complete source bytes (%) + Share of each row's own baseline bytes (%) - 1. All · Full source + Progressive view / original capture - 2. Progressive · Fold tail + In-cycle Delta / full delivery - 3. Prog + In-cycle Delta - - - - - - 4. Prog + Delta First read + Manual selection / tutorial capture - - - - - + - - + + + 9.0% (5,107 / 57,014 B) + - 100.0% (57,014 B) + 39.0% (2,164 / 5,543 B) - 9.7% (5,543 B · fold long tail) + 1.3% (674 / 51,547 B · 2.6% CLI) - 3.8% (2,164 B · −61.0% vs Prog) - - - 1.2% (674 B body / 2.4% CLI) - - - A. Same-source 4-stage cascade + A. Three independent archived tutorial comparisons - + - + - - + + 0 - + - - + + 25 - + - - + + 50 - + - - + + 75 - + - - + + 100 - + Share of Progressive selected bytes (%) - - - + + + Progressive selected (46) - - - + + + + In-cycle Delta (all 46) - - - + + + + In-cycle Delta (24 delta) - + - + - + - + 100.0% (3.09 MB selected base) - + 61.5% (1.90 MB · −38.54%) - + 25.75% (in-cycle −74.25%) - + B1. 18h core layer: stacking compaction-cycle Delta (ANN) - + - + - - + + 0 - + - - + + 25 - + - - + + 50 - + - - + + 75 - + - - + + 100 - + Share of cohort Full bytes (%) - - - + + + All · Full packets - - - + + + Progressive · 213 wakes - - - + + + Prog+Delta First read · 112 - + - + - + - + 100.0% (22.41 MB / in-cycle ≈12.53 MB) - + 32.5% (7.29 MB · −67.5%) - + ≈ 3.0% body / ≈ 5.0% CLI (−97% / −95%) - + B2. 8-task 18h cohorts: 100% Full to Prog+Delta entry - - Step-Down from 100%: All → Progressive → Compaction-Cycle Structured Delta → First Read + + Layered context: separate tutorial comparisons and 18h in-cycle Delta observations - - Progressive lookup folds long-tail history; the core mechanism reuses verified subtrees within a compaction epoch and resets on compaction. + + Progressive views retain necessary facts; in-cycle Delta reuses verified subtrees. Compaction or mismatch restores the complete baseline. - - A: exact same-source pipeline (measurements.json, single 57,014 B denominator). B1: ANN 18h paired trajectory stacking compaction-cycle Delta on selected packets. + + A: independent archived comparisons in measurements.json; 674 B is a manual three-path selection, not a measured stacked --initial-read. B2: 8-task shares over 213 wakes (Progressive) and 112 in-cycle continuations (Prog+Delta first-read); each cohort keeps its own denominator. diff --git a/apps/presentation/site/public/blog/images/context-delivery/context-cascade-zh.svg b/apps/presentation/site/public/blog/images/context-delivery/context-cascade-zh.svg index 264323ee54..465b77db9e 100644 --- a/apps/presentation/site/public/blog/images/context-delivery/context-cascade-zh.svg +++ b/apps/presentation/site/public/blog/images/context-delivery/context-cascade-zh.svg @@ -93,85 +93,68 @@ L 374.277959 109.296 - 占完整原始捕获字节 (%) + 占各行自身对照基线的字节 (%) - 1. All · 完整上下文 + Progressive 必要视图 / 原捕获 - 2. Progressive · 渐进折叠 + 周期内 Delta / 本轮完整交付 - 3. Prog + 周期内结构化 Delta - - - - - - 4. Prog + Delta First Read + 手工批量选读 / 教程捕获 - - - - - + - - + + + 9.0% (5,107 / 57,014 B) + - 100.0% (57,014 B) + 39.0% (2,164 / 5,543 B) - 9.7% (5,543 B · 按需折叠长尾) + 1.3% (674 / 51,547 B · 2.6% CLI) - 3.8% (2,164 B · 较 Prog 再减 −61.0%) - - - 1.2% (674 B 正文 / 2.4% CLI) - - - A. 同源流水线四阶叠加削减(固定基准) + A. 归档教程的三组独立对照 - + - + - - + + 0 - + - - + + 25 - + - - + + 50 - + - - + + 75 - + - - + + 100 - + 占 Progressive 选中字节 (%) - - - + + + Progressive 选中包 (46 轮) - - - + + + + 周期内 Delta (全 46 轮) - - - + + + + 周期内 Delta (24 增量轮) - + - + - + - + 100.0% (3.09 MB 选中基线) - + 61.5% (1.90 MB · 再减 −38.54%) - + 25.75% (同周期再减 −74.25%) - + B1. 18h 实测核心增量:叠加压缩周期内结构化 Delta(ANN) - + - + - - + + 0 - + - - + + 25 - + - - + + 50 - + - - + + 75 - + - - + + 100 - + 占对应唤醒组 Full 字节 (%) - - - + + + All · 完整决策包 - - - + + + Progressive · 213 次 - - - + + + Prog+Delta 首读 · 112 次 - + - + - + - + 100.0% (22.41 MB / 续跑 ≈12.53 MB) - + 32.5% (7.29 MB · 净减 −67.5%) - + ≈ 3.0% 正文 / ≈ 5.0% CLI (−97% / −95%) - + B2. 八题 18h 队列汇总:从 100% 到叠加首读入口 - - 从 100% 逐层削减:All → Progressive → 压缩周期内结构化 Delta → First Read + + 分层上下文:独立教程对照与 18h 周期内差分观测 - - 渐进选读仅按需折叠历史长尾;核心机制是在有效 Compaction 周期内精确复用不变结构子树,并在压缩或失配时原子恢复完整基线。 + + 渐进视图保留必要事实;周期内结构化 Delta 复用已验证子树。压缩或失配恢复完整基线,不保证任意输入逐级变小。 - - A:同源固定流水线(measurements.json,同一 57,014 B 分母)。B1:ANN 18h 配对轨迹在选中包(3.09 MB)上叠加周期内结构化 Delta 的进一步削减。 + + A:measurements.json 的独立归档对照,各行分母不同;674 B 为三个 --select 的手工选读,未测同源四阶段的 --initial-read。 B2:八题 213 次唤醒(Progressive)与 112 次同周期续跑(Prog+Delta 首读)各自相对原分母的比例;跨队列分母分开列出,不做混乘。 diff --git a/apps/presentation/site/public/blog/zh/context-delivery/index.html b/apps/presentation/site/public/blog/zh/context-delivery/index.html index 80af5c8898..17e0b293b7 100644 --- a/apps/presentation/site/public/blog/zh/context-delivery/index.html +++ b/apps/presentation/site/public/blog/zh/context-delivery/index.html @@ -6,13 +6,13 @@ -
    ← 全部文章

    Context delivery

    Agent 读上下文,也需要一套“查书”的方法

    从 100% 全量捕获逐层削减:按需渐进折叠长尾,在有效 compaction 周期内交付结构化差分上下文,并在压缩后无损恢复基线。

    -

    Agent 做长任务,资料会越来越多:原目标、后来追加的约束、试过的方案、失败的实验、当前做到哪里。每次继续都把整份材料再塞一遍,重复会不断累积;只留一段摘要,又可能找不回决定所依赖的原话。

    +
    ← 全部文章

    Context delivery

    Agent 读上下文,也需要一套“查书”的方法

    先读必要事实,在有效 compaction 周期内复用已验证的结构;连续性丢失时恢复完整基线。

    +

    Agent 做长任务,资料会越来越多:原目标、后来追加的约束、试过的方案、失败的实验、当前做到哪里。每次继续都把整份材料再塞一遍,重复会不断累积;只留一段摘要,又可能找不回决定所依赖的原话。

    按 JSON Pointer 渐进选读本身并不复杂,主要用来折叠当前决定暂不需要的历史长尾;LoopX 上下文交付真正的机制重心,是受 compaction 周期约束的结构化差分上下文(compaction-cycle structured delta):完整来源先落盘存证,在同一个已核验的 context_epoch 内精确复用未变化的结构子树、只编码本轮结构增删改;一旦宿主发生上下文压缩或基线摘要失配,立即原子切换回新的完整基线,绝不悬空叠加旧差分。

    先看数据:从 100% 逐层削减、周期内结构化差分与任务消融

    -

    四阶叠加流水线:All → Progressive → 压缩周期内结构化 Delta → First Read

    -

    按实际叠加顺序看,上下文体积沿着四级流水线单调递减:先从 100% 完整捕获(All)折叠长尾得到 Progressive 必要视图,再在同一有效 compaction 周期内叠加结构化差分(Progressive + Delta),最后以受字节预算保护的 --initial-read 首读入口(Progressive + Delta First Read)送达当前轮起始事实:

    -

    从 100% 逐层削减:同源四阶流水线与 18h 轨迹周期内差分实测

    从 100% 逐层削减:同源流水线 All 100% → Progressive 9.7% → Prog+周期内Delta 3.8% → 首读 1.2%,以及 ANN 18h 周期内结构化差分再减 38.54% / 74.25% 与八题首读阶梯
    A:后文同源固定流水线(measurements.json,同一 57,014 B 分母)的四阶单调削减,在 Progressive(9.7%)之上叠加周期内结构化 Delta 再减 61.0%(至 3.8%),首读正文降至 1.2%。B1:ANN 18h 配对轨迹在 Progressive 选中包(3.09 MB)上叠加周期内结构化 Delta,全 46 轮再减 38.54%,24 个同周期增量轮再减 74.25%。B2:八题 213 次唤醒(Progressive 32.5%)与 112 次同周期续跑(Prog+Delta 首读正文 3.0% / CLI 5.0%)各自相对原分母的比例。
    +

    四种机制,分别核对测量基线

    +

    完整捕获、Progressive 必要视图、压缩周期内结构化 Delta 与受预算保护的 --initial-read 可以组合,但不保证任意输入的字节数逐级单调递减。Delta 依赖同周期内已验证的基线;新周期、摘要失配或完整表示更小时,恢复完整交付。下图教程数据是三组独立对照,不是同源四阶实测流水线。

    +

    独立教程对照与 18h 压缩周期内差分观测

    独立教程对照:必要视图 5,107 / 57,014 B(9.0%);周期内 Delta 2,164 / 5,543 B(39.0%);手工选读 674 / 51,547 B(正文 1.3%)。ANN 与八题历史队列各自保留原分母。
    A:measurements.json 的三组归档教程对照:必要视图为 5,107 / 57,014 B(9.0%);下一份捕获的 Delta 文件为 2,164 / 5,543 B,相对本轮完整 Progressive 交付文件保留 39.0%;另一份 51,547 B 的 capture.json 手工选择三个路径,返回 674 B 正文(1.3%),含 CLI 元数据为 1,362 B(2.6%)。674 B 不是 Progressive+Delta 后执行 --initial-read 的实测。这里保留的是 measurements.json 所注明源码版本的历史观测,输出大小可能随源码版本和读取路径变化。B1:ANN 归档 18h 配对以选中包为基线,全 46 轮再减 38.54%,24 个周期内增量轮再减 74.25%。B2:八题的 213 次唤醒与 112 次续跑各用原分母,不与教程数字串成一条削减链。

    八题对照:区分单层载荷(Progressive / 无损 Delta 文件)与叠加首读

    阅读下方已公开的八题四臂 Context ON 18h 聚合表时,需要区分单层文件载荷与双层叠加首读:原表共覆盖 213 次模型侧唤醒(101 次新会话或压缩后的基线读取 + 112 次同周期续跑),其中「同周期 Delta 载荷」列(4.49 MB / 约 12.53 MB = 35.8%)统计的是磁盘上尚未叠加渐进裁剪的单路无损 delivery.json 文件(All → Delta),与「Progressive 必要视图」(7.29 / 22.41 MB = 32.5%,All → Progressive)属于平行的单层裁剪,而非叠加后的 Progressive + Delta;把渐进选读与周期内差分真正叠在一起的,是最后一列 Prog+Delta 首读入口(3.0% 正文 / 5.0% 含 CLI 封装)。逐题单元格保留来源原值,合计按表重算;这里不附原始逐 wake 日志。

      diff --git a/apps/presentation/site/scripts/generate-long-horizon-audit.py b/apps/presentation/site/scripts/generate-long-horizon-audit.py index f023d79692..4acda82a8c 100644 --- a/apps/presentation/site/scripts/generate-long-horizon-audit.py +++ b/apps/presentation/site/scripts/generate-long-horizon-audit.py @@ -32,11 +32,14 @@ def save(fig, relative): for language in ("en", "zh"): zh = language == "zh" - # 1. Four-stage monotonic step-down cascade: - # All (100%) -> Progressive -> Progressive + Compaction-Cycle Structured Delta -> First Read + # 1. Independent archived tutorial comparisons, not one measured cascade. + # Each numerator is paired with its own recorded baseline. In particular, + # a manual --select response is not a native --initial-read measurement. orig_b = LESSON["native_projection"]["original_bytes"] + required_b = LESSON["native_projection"]["required_bytes"] prog_b = LESSON["cycle_codec"]["current_full_bytes"] pdelta_b = LESSON["cycle_codec"]["delta_bytes"] + manual_source_b = next(r for r in LESSON["reader_rows"] if r["case"] == "complete_capture")["body_bytes"] batch_row = next(r for r in LESSON["reader_rows"] if r["case"] == "one_batched_select") first_body_lesson = batch_row["body_bytes"] first_cli_lesson = batch_row["output_bytes"] @@ -50,49 +53,38 @@ def save(fig, relative): right_top = fig.add_subplot(gs[0, 1]) right_bot = fig.add_subplot(gs[1, 1]) - cascade_vals = [100.0, 100 * prog_b / orig_b, 100 * pdelta_b / orig_b, 100 * first_body_lesson / orig_b] + cascade_vals = [100 * required_b / orig_b, 100 * pdelta_b / prog_b, + 100 * first_body_lesson / manual_source_b] cascade_labels = ( [ - "1. All · 完整上下文", - "2. Progressive · 渐进折叠", - "3. Prog + 周期内结构化 Delta", - "4. Prog + Delta First Read", + "Progressive 必要视图 / 原捕获", + "周期内 Delta / 本轮完整交付", + "手工批量选读 / 教程捕获", ] if zh else [ - "1. All · Full source", - "2. Progressive · Fold tail", - "3. Prog + In-cycle Delta", - "4. Prog + Delta First read", + "Progressive view / original capture", + "In-cycle Delta / full delivery", + "Manual selection / tutorial capture", ] ) - cascade_notes = ( - [ - f"100.0% ({orig_b:,} B)", - f"{cascade_vals[1]:.1f}% ({prog_b:,} B · 按需折叠长尾)", - f"{cascade_vals[2]:.1f}% ({pdelta_b:,} B · 较 Prog 再减 −61.0%)", - f"{cascade_vals[3]:.1f}% ({first_body_lesson:,} B 正文 / {100*first_cli_lesson/orig_b:.1f}% CLI)", - ] - if zh else - [ - f"100.0% ({orig_b:,} B)", - f"{cascade_vals[1]:.1f}% ({prog_b:,} B · fold long tail)", - f"{cascade_vals[2]:.1f}% ({pdelta_b:,} B · −61.0% vs Prog)", - f"{cascade_vals[3]:.1f}% ({first_body_lesson:,} B body / {100*first_cli_lesson/orig_b:.1f}% CLI)", - ] - ) - left.barh(range(4), cascade_vals, color=[SLATE, BLUE, TEAL, PURPLE], height=.50) - left.set_yticks(range(4), cascade_labels, fontsize=10.2) + cascade_notes = [ + f"{cascade_vals[0]:.1f}% ({required_b:,} / {orig_b:,} B)", + f"{cascade_vals[1]:.1f}% ({pdelta_b:,} / {prog_b:,} B)", + f"{cascade_vals[2]:.1f}% ({first_body_lesson:,} / {manual_source_b:,} B · {100*first_cli_lesson/manual_source_b:.1f}% CLI)", + ] + left.barh(range(3), cascade_vals, color=[BLUE, TEAL, PURPLE], height=.50) + left.set_yticks(range(3), cascade_labels, fontsize=10.2) left.invert_yaxis() left.set_xlim(0, 168) - left.set_xlabel("占完整原始捕获字节 (%)" if zh else "Share of complete source bytes (%)", fontsize=9.8) + left.set_xlabel("占各行自身对照基线的字节 (%)" if zh else "Share of each row's own baseline bytes (%)", fontsize=9.8) left.set_title( - "A. 同源流水线四阶叠加削减(固定基准)" if zh else "A. Same-source 4-stage cascade", + "A. 归档教程的三组独立对照" if zh else "A. Three independent archived tutorial comparisons", loc="left", pad=14, fontsize=11.5, fontweight="bold", ) for idx, (val, note) in enumerate(zip(cascade_vals, cascade_notes)): - weight = "bold" if idx == 2 else "normal" - color = "#0f766e" if idx == 2 else "#0f172a" + weight = "bold" if idx == 1 else "normal" + color = "#0f766e" if idx == 1 else "#0f172a" left.text(val + 2.2, idx, note, va="center", fontsize=9.6, fontweight=weight, color=color) # Panel B1: Real 18h ANN paired audit — stacking Compaction-Cycle Structured Delta on top of Progressive @@ -195,22 +187,22 @@ def save(fig, relative): axis.set_xticks([0, 25, 50, 75, 100]) fig.suptitle( - "从 100% 逐层削减:All → Progressive → 压缩周期内结构化 Delta → First Read" + "分层上下文:独立教程对照与 18h 周期内差分观测" if zh else - "Step-Down from 100%: All → Progressive → Compaction-Cycle Structured Delta → First Read", + "Layered context: separate tutorial comparisons and 18h in-cycle Delta observations", fontsize=15.0, fontweight="bold", y=.955, ) sub = ( - "渐进选读仅按需折叠历史长尾;核心机制是在有效 Compaction 周期内精确复用不变结构子树,并在压缩或失配时原子恢复完整基线。" + "渐进视图保留必要事实;周期内结构化 Delta 复用已验证子树。压缩或失配恢复完整基线,不保证任意输入逐级变小。" if zh else - "Progressive lookup folds long-tail history; the core mechanism reuses verified subtrees within a compaction epoch and resets on compaction." + "Progressive views retain necessary facts; in-cycle Delta reuses verified subtrees. Compaction or mismatch restores the complete baseline." ) fig.text(.5, .87, sub, ha="center", fontsize=10.2, color="#475569") footer_cascade = ( - "A:同源固定流水线(measurements.json,同一 57,014 B 分母)。B1:ANN 18h 配对轨迹在选中包(3.09 MB)上叠加周期内结构化 Delta 的进一步削减。\n" + "A:measurements.json 的独立归档对照,各行分母不同;674 B 为三个 --select 的手工选读,未测同源四阶段的 --initial-read。\n" "B2:八题 213 次唤醒(Progressive)与 112 次同周期续跑(Prog+Delta 首读)各自相对原分母的比例;跨队列分母分开列出,不做混乘。" if zh else - "A: exact same-source pipeline (measurements.json, single 57,014 B denominator). B1: ANN 18h paired trajectory stacking compaction-cycle Delta on selected packets.\n" + "A: independent archived comparisons in measurements.json; 674 B is a manual three-path selection, not a measured stacked --initial-read.\n" "B2: 8-task shares over 213 wakes (Progressive) and 112 in-cycle continuations (Prog+Delta first-read); each cohort keeps its own denominator." ) fig.text(.03, .03, footer_cascade, fontsize=9.4, color="#475569", linespacing=1.5) diff --git a/examples/blog-bilingual-index-smoke.mjs b/examples/blog-bilingual-index-smoke.mjs index 9f213617d9..d99c731653 100644 --- a/examples/blog-bilingual-index-smoke.mjs +++ b/examples/blog-bilingual-index-smoke.mjs @@ -109,13 +109,23 @@ export async function validateBilingualBlog(blogDir) { assertIncludes(article, "32.5%", "The weighted share matches the public rows"); const langSuffix = locale === "zh/" ? "zh" : "en"; assertIncludes(article, `context-cascade-${langSuffix}.svg`, - "Both published editions must embed the 100% four-stage cascade chart"); + "Both published editions must embed the context measurement comparisons"); const cascadeSvg = await readFile( resolve(blogDir, `images/context-delivery/context-cascade-${langSuffix}.svg`), "utf8", ); - for (const token of ["100.0%", "−61.0%", "−74.25%"]) { - assertIncludes(cascadeSvg, token, `Cascade chart must retain verified step-down figure: ${langSuffix} ${token}`); + const lesson = JSON.parse(await readFile(resolve(blogDir, "context-delivery/measurements.json"), "utf8")); + const manual = lesson.reader_rows.find(row => row.case === "one_batched_select"); + const full = lesson.reader_rows.find(row => row.case === "complete_capture"); + for (const [method, numerator, denominator] of [ + ["progressive", lesson.native_projection.required_bytes, lesson.native_projection.original_bytes], + ["cycle-delta", lesson.cycle_codec.delta_bytes, lesson.cycle_codec.current_full_bytes], + ["manual-select", manual.body_bytes, full.body_bytes], + ]) { + assertIncludes(article, `data-comparison-${method}="${numerator}/${denominator}"`, + "Each comparison must retain its own measured numerator and denominator"); + const pair = [numerator, denominator].map(value => value.toLocaleString("en-US")).join(" / "); + assertIncludes(cascadeSvg, pair, `Chart and article must agree on the measured pair: ${method}`); } const multitaskSvg = await readFile( resolve(blogDir, `images/context-delivery/multitask-byte-ratios-${langSuffix}.svg`), From 0a1c4a31c815d61fa3edc507dcb555df615acfe9 Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Thu, 12 Nov 2026 02:50:48 +0800 Subject: [PATCH 3/3] docs(blog): align entry summaries with independent comparisons Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- apps/presentation/site/public/blog/context-delivery/index.html | 2 +- apps/presentation/site/public/blog/index.html | 2 +- .../site/public/blog/zh/context-delivery/index.html | 2 +- apps/presentation/site/public/blog/zh/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/presentation/site/public/blog/context-delivery/index.html b/apps/presentation/site/public/blog/context-delivery/index.html index c40a10cd00..cfc155b805 100644 --- a/apps/presentation/site/public/blog/context-delivery/index.html +++ b/apps/presentation/site/public/blog/context-delivery/index.html @@ -9,7 +9,7 @@
      ← All articles

      Context delivery

      An Agent needs a way to look things up, too

      Read necessary facts first, reuse verified structures within a compaction cycle, and recover the complete baseline when continuity is lost.

      Long-running work accumulates material: the original goal, later constraints, attempted routes, failed experiments and current progress. Sending everything again on each continuation repeats more and more content; keeping only a summary can make the original basis of a decision difficult to recover.

      Selective JSON Pointer lookup by itself is straightforward—it folds long-tail history not needed for the immediate decision. The core mechanism in LoopX's context delivery is compaction-cycle-bounded structured delta context: complete sources are saved first, unchanged typed subtrees are reused exactly against a verified baseline within the active context_epoch, and any host compaction or digest mismatch atomically resets to a fresh complete baseline rather than chaining dangling deltas.

      -

      Results first: four-stage step-down, compaction-cycle deltas and task ablation

      +

      Evidence: separate context comparisons, cycle deltas and task ablation

      Four mechanisms, with separate measurement baselines

      Complete capture, Progressive views, compaction-cycle structured Delta and a bounded --initial-read are composable mechanisms, but their bytes do not decrease monotonically for every input. Delta requires a verified same-cycle baseline; a new epoch, mismatch or smaller full representation uses complete delivery. The archived tutorial below measures three independent comparisons, not a same-source four-stage cascade.

      Separate tutorial comparisons and 18h compaction-cycle Delta observations

      Independent tutorial comparisons: Progressive view 5,107 / 57,014 B (9.0%); in-cycle Delta 2,164 / 5,543 B (39.0%); manual selection 674 / 51,547 B (1.3% body). ANN and eight-task archived cohorts retain separate baselines.
      A: Three archived tutorial comparisons from measurements.json: the necessary view is 5,107 / 57,014 B (9.0%); the next capture's Delta file is 2,164 / 5,543 B of its full Progressive delivery file (39.0%); manually selecting three paths from the separate 51,547 B capture.json returns 674 B (1.3% body), or 1,362 B including CLI metadata (2.6%). The 674 B is not a measured --initial-read after Progressive + Delta. These saved observations belong to the revision recorded in measurements.json; output size may change with source revision and reader paths. B1: ANN's archived 18h pairs compare Delta against selected packets, with 38.54% reduction across 46 events and 74.25% across 24 in-cycle Delta events. B2: Eight-task aggregates retain the separate 213-wake and 112-continuation denominators; their percentages cannot be chained into this tutorial.
      diff --git a/apps/presentation/site/public/blog/index.html b/apps/presentation/site/public/blog/index.html index cb8bef8477..48f54b102c 100644 --- a/apps/presentation/site/public/blog/index.html +++ b/apps/presentation/site/public/blog/index.html @@ -36,7 +36,7 @@

      Context delivery · Mechanisms and examples

      · Updated November 12

      -

      An Agent needs a way to look things up, too

      Step down from 100% saved context: fold long-tail history (32.5% across 213 wakes), stack compaction-cycle structured deltas (−74.25% on ANN in-cycle wakes; ≈ 3.0% / 5.0% 8-task first-read entry), and reset cleanly on compaction.

      Read article
      +

      An Agent needs a way to look things up, too

      Read progressive views and compaction-cycle deltas with their own measurement baselines: 32.5% across 213 wakes, −74.25% on ANN in-cycle wakes, and ≈ 3.0% / 5.0% eight-task first-read entry. Compaction resets the complete baseline; these cohorts are separate comparisons.

      Read article

      Research notes · EdgeBench and LHTB

      diff --git a/apps/presentation/site/public/blog/zh/context-delivery/index.html b/apps/presentation/site/public/blog/zh/context-delivery/index.html index 17e0b293b7..5c7d831090 100644 --- a/apps/presentation/site/public/blog/zh/context-delivery/index.html +++ b/apps/presentation/site/public/blog/zh/context-delivery/index.html @@ -9,7 +9,7 @@
      ← 全部文章

      Context delivery

      Agent 读上下文,也需要一套“查书”的方法

      先读必要事实,在有效 compaction 周期内复用已验证的结构;连续性丢失时恢复完整基线。

      Agent 做长任务,资料会越来越多:原目标、后来追加的约束、试过的方案、失败的实验、当前做到哪里。每次继续都把整份材料再塞一遍,重复会不断累积;只留一段摘要,又可能找不回决定所依赖的原话。

      按 JSON Pointer 渐进选读本身并不复杂,主要用来折叠当前决定暂不需要的历史长尾;LoopX 上下文交付真正的机制重心,是受 compaction 周期约束的结构化差分上下文(compaction-cycle structured delta):完整来源先落盘存证,在同一个已核验的 context_epoch 内精确复用未变化的结构子树、只编码本轮结构增删改;一旦宿主发生上下文压缩或基线摘要失配,立即原子切换回新的完整基线,绝不悬空叠加旧差分。

      -

      先看数据:从 100% 逐层削减、周期内结构化差分与任务消融

      +

      先看数据:独立上下文对照、周期内结构化差分与任务消融

      四种机制,分别核对测量基线

      完整捕获、Progressive 必要视图、压缩周期内结构化 Delta 与受预算保护的 --initial-read 可以组合,但不保证任意输入的字节数逐级单调递减。Delta 依赖同周期内已验证的基线;新周期、摘要失配或完整表示更小时,恢复完整交付。下图教程数据是三组独立对照,不是同源四阶实测流水线。

      独立教程对照与 18h 压缩周期内差分观测

      独立教程对照:必要视图 5,107 / 57,014 B(9.0%);周期内 Delta 2,164 / 5,543 B(39.0%);手工选读 674 / 51,547 B(正文 1.3%)。ANN 与八题历史队列各自保留原分母。
      A:measurements.json 的三组归档教程对照:必要视图为 5,107 / 57,014 B(9.0%);下一份捕获的 Delta 文件为 2,164 / 5,543 B,相对本轮完整 Progressive 交付文件保留 39.0%;另一份 51,547 B 的 capture.json 手工选择三个路径,返回 674 B 正文(1.3%),含 CLI 元数据为 1,362 B(2.6%)。674 B 不是 Progressive+Delta 后执行 --initial-read 的实测。这里保留的是 measurements.json 所注明源码版本的历史观测,输出大小可能随源码版本和读取路径变化。B1:ANN 归档 18h 配对以选中包为基线,全 46 轮再减 38.54%,24 个周期内增量轮再减 74.25%。B2:八题的 213 次唤醒与 112 次续跑各用原分母,不与教程数字串成一条削减链。
      diff --git a/apps/presentation/site/public/blog/zh/index.html b/apps/presentation/site/public/blog/zh/index.html index 55a6c22d95..b2d02fc689 100644 --- a/apps/presentation/site/public/blog/zh/index.html +++ b/apps/presentation/site/public/blog/zh/index.html @@ -36,7 +36,7 @@

      Context delivery · 机制与实例

      · 11 月 12 日更新

      -

      Agent 读上下文,也需要一套“查书”的方法

      从 100% 完整捕获逐层削减:按需渐进折叠长尾(213 次唤醒保留 32.5%),在有效 compaction 周期内叠加结构化差分(ANN 增量轮再减 74.25%,八题首读入口降至约 3.0% / 5.0%),压缩或失配即原子恢复完整基线。

      阅读全文
      +

      Agent 读上下文,也需要一套“查书”的方法

      分别核对渐进视图与周期内差分的测量基线:213 次唤醒保留 32.5%,ANN 周期内增量轮再减 74.25%,八题首读入口约 3.0% / 5.0%。这些队列独立比较,压缩或失配即恢复完整基线。

      阅读全文

      研究札记 · EdgeBench 与 LHTB