From a8a5bd43775d7cdc23e978a69e4b160408436b0c Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 15 Nov 2026 14:38:49 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=203=20=F0=9F=9F=A1=20(0=20misread);=20state=20ite?= =?UTF-8?q?m=20190=20for=20every=20run=20crossing=20a=20hard=20break,=20na?= =?UTF-8?q?me=20trimmingRuns=20in=20the=20decision,=20say=20the=20run=20re?= =?UTF-8?q?aches=20between=20its=20non-blank=20holders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/decisions.md | 2 +- src/markdown/portable/inline-reduction.ts | 2 +- todo.md | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/decisions.md b/docs/decisions.md index feed626..28c7f3d 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -813,7 +813,7 @@ grouping, with the span rule in one home. `inlineRuns` in `emit/inline-runs.ts` says which node a run passes, and a run ends at its last holder. The writer tries the spanned line once and, where it needs any fallback, runs its fallback loop on the parted line, so `takeFallback` takes what it is handed; whether a node is carried is decided once per pass, on its `RunNode` (the restructure of 2026-11-04). The reducer judges the same two lines, each trimmed by -its own runs, which `runsSharedWithNext` counts beside `inlineRuns`. `withoutOpeningLinkCode` +its own runs, which `trimmingRuns` counts beside `inlineRuns`. `withoutOpeningLinkCode` stays on `insideRun` alone, since it answers the parted line. A refactor that merges as its own chunk took its own ruling, so the chunk's later rulings read against that merge, the commit `larv-review ruling-base` prints. A restructure past a pass's round cap still goes unreviewed, so the PR summary names it. diff --git a/src/markdown/portable/inline-reduction.ts b/src/markdown/portable/inline-reduction.ts index 71433dd..0806226 100644 --- a/src/markdown/portable/inline-reduction.ts +++ b/src/markdown/portable/inline-reduction.ts @@ -250,7 +250,7 @@ function edgeOutcome(marks: readonly AdfMark[], { lineEdge, sharedRuns }: Beside return depth === 0 && lineEdge ? { kind: 'drop' } : { depth, kind: 'keep' } } -// For each leaf but the last, how many of `grouping`'s runs hold it and the next leaf; an edge-stripping mark's run spans only its leaves holding more than spaces and tabs, as the trim strips the mark off blank leaves past them, else one pass each. +// For each leaf but the last, how many of `grouping`'s runs hold it and the next leaf; an edge-stripping mark's run reaches only from its first to its last non-blank holder, since the trim strips the mark off the blank holders outside, one pass each if they counted. export function trimmingRuns(leaves: readonly AdfNode[], grouping: RunGrouping): number[] { const shared = leaves.map(() => 0) countTrimmingRuns(leaves.map((node) => ({ carried: false, node, outer: 0 })), 0, grouping, shared) diff --git a/todo.md b/todo.md index 415089e..213d2db 100644 --- a/todo.md +++ b/todo.md @@ -52,8 +52,10 @@ edge, and only then is its neighbour at the edge. Blank leaves alternating linke a hard break, then a linked leaf, take n + 1 passes: 101, 1 001 and 10 001 at n = 100, 1 000 and 10 000, so the trim is quadratic, against goal 9. An unmarked blank drops at the edge; a linked blank drops once the link run crosses the hard break to the linked leaf, which the unmarked blank between -breaks until it drops. Item 174's truncated runs leave this cascade as it was, since a link doesn't -strip edge whitespace. Count passes to measure, never time (§Cost fixes are measured, never timed). +breaks until it drops. Any run crossing a hard break cascades the same way, one blank per pass, an em +run too: `'a'` em, a hard break, blanks alternating em and `[em, link]`, then `'b'` em take 7, 101 and +1 001 passes at n = 6, 100 and 1 000. Item 174's runs, counted between their non-blank holders, leave +these blanks inside. Count passes to measure, never time (§Cost fixes are measured, never timed). Found by item 174's chunk, 2026-11-15. ### 51. Match a reference label to its definition under Unicode case folding.