From 6fd2e7ce071ac28117e54b58682791371a0cdb03 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 30 Oct 2026 21:00:05 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20prose=20round=201:=200=20=F0=9F=94=B4,?= =?UTF-8?q?=204=20=F0=9F=9F=A1=20(0=20misread);=20retitle=20and=20rewrite?= =?UTF-8?q?=20the=20cap's=20entry,=20measure=20the=20changelog=20against?= =?UTF-8?q?=200.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 2 +- CHANGELOG.md | 8 ++++---- docs/decisions.md | 18 +++++++++++------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 247cf46..572319b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -75,7 +75,7 @@ In `docs/decisions.md`: - No value `JSON.parse` or `structuredClone` builds loops a call - Nothing spreads an unbounded array - A retry loop checks its own termination -- A line reads back at most 32 times, then takes back every emphasis run +- After 32 passes, a line carries or drops every em, strike and strong mark - Readers scan by index - The spelling memo - Cost fixes are measured, never timed diff --git a/CHANGELOG.md b/CHANGELOG.md index d305035..d5cc88f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,10 +62,10 @@ strong: text `un` beside `-r` marked em and strong, repeated 1000 times, took up to 9 seconds, now under 170 ms, and `(` marked em, strike and strong beside a mention, repeated 1000 times, took 18 seconds in `adfToPortableMarkdown`, now 150 ms. A line where em shares a delimiter run - with strong takes time linear in its length: ` ~~ ` marked em and strong, `)` marked em, strike - and strong, `a`, then `.unun` marked strike and strong, repeated 1000 times, took 33 seconds in - `adfToLosslessMarkdown` and 39 in `adfToPortableMarkdown`, now 2.6 and 1.5 seconds. A line whose - emphasis still reads back wrong after 32 tries is written with every node holding em, strike or + with strong takes time linear in its length: `~~` between spaces marked em and strong, `)` marked + em, strike and strong, `a`, then `.unun` marked strike and strong, repeated 1000 times, took 56 + seconds in `adfToLosslessMarkdown` and 130 in `adfToPortableMarkdown`, now 2.6 and 1.5 seconds. A + line still read back wrong after 32 tries is written with every node holding em, strike or strong as `!adf:carry{json="…"}` in `adfToLosslessMarkdown`, and without those marks in `adfToPortableMarkdown`. - `adfToLosslessMarkdown` and `adfToPortableMarkdown` take time linear in the markdown when lists diff --git a/docs/decisions.md b/docs/decisions.md index 0789d6a..2df5ba5 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -908,17 +908,21 @@ fine. A loop retrying an input until a fallback spells it refuses the pass taking no fallback, so its termination is the loop's own check. -## A line reads back at most 32 times, then takes back every emphasis run +## After 32 passes, a line carries or drops every em, strike and strong mark 2026-10-30, the maintainer. Goals 9 and 1. Valid while a writer finds a misread run only by reading the line back. -The lossless and portable writers read a line back after each fallback, and the sweep takes back -the misread pairs it can prove fall together. Where a strong opener captures the `*` em leaves over, -the sweep can't predict it, so one pass took back one strong, and a line of 1000 such repeats took -33 seconds. After 32 passes the line takes back every em, strong and strike run at once: the -lossless writer carries every node holding one, and the portable writer drops those marks. That -line keeps fewer marks than the pass-by-pass result would, in exchange for time linear in the line. +Each pass, the lossless and portable writers spell the line, read it back, and fall back on the +first misread emphasis run and on every run `unspellableRuns` proves falls with it: the lossless +writer carries the run's nodes, and the portable writer drops its mark. When em and strong share a +delimiter run, as in `***`, and the strong closes first, the next strong opener can pair with em's +leftover `*`. `unspellableRuns` can't foresee that pairing, so each pass falls back on one strong, +and a line repeating such a pattern 1000 times took 33 seconds lossless and 39 portable. After 32 +passes, both writers fall back on every em, strike and strong run at once. Such a line keeps fewer +marks than one strong per pass would leave, and takes time linear in its length. 32 clears the +most passes any line in the suite needs, 22 portable and 5 lossless, with room to spare. The +`first` mode, which only a property uses, takes no cap. ## Readers scan by index