@@ -327,6 +327,61 @@ words) are unmeasured at this depth — a natural follow-up, not a blocker,
327327given the confirmed pattern (soundness holds, memo dominates the win) on
328328the one word measured to completion.
329329
330+ ** Aggregate corpus evidence: count-based and wall-clock, reported
331+ separately (see the harness's own two-line report format).** A Sena
332+ sub-corpus (words 1-70, 200s per-side timeout — long enough for the one
333+ tractable heavy word in this range to complete on both sides, per §5's H1
334+ measurement above) gives, of the 69 words that completed within budget:
335+ ** 53/69 (77%) faster under memo, 16/69 (23%) slower** — count-based, this
336+ is the "yes, some words are slower" half of the picture. ** Wall-clock:
337+ memo-on total 114.6s vs memo-off total 277.8s across those same 69
338+ words — 2.42× faster in aggregate** — this is the "but a lot are faster,
339+ and it nets out strongly positive" half. The one word that timed out at
340+ 200s (a second tractable-but-slow heavy word, distinct from both H1 and
341+ H2) is excluded from both numbers; since it timed out even with the memo
342+ on, its memo-off side is presumably at least as slow, so ** this 2.42×
343+ figure is a conservative lower bound** , not an inflated one — a longer
344+ timeout could only raise it. Both memo tables fired heavily and
345+ non-vacuously on this slice (mrule: tens of thousands of positive/nogood
346+ hits; template: tens of thousands positive, near-zero nogood).
347+
348+ ** Is the typical-word slowdown "just" losing a thread? Mostly, not
349+ purely.** Isolated on Indonesian (no template redundancy — the cleanest
350+ instrument for this, since the template memo never replays there) via
351+ three repeated runs per configuration to average out run-to-run JIT/GC
352+ noise (single-run absolute times varied by as much as 60% between
353+ otherwise-identical runs of the unchanged parallel baseline — only
354+ within-run memo-on-vs-memo-off ratios are trustworthy here, not
355+ across-run absolute milliseconds):
356+
357+ | Configuration vs parallel-default | Aggregate ratio (3 reps) | Implied slowdown |
358+ | ---| ---| ---|
359+ | sequential + memo (shipped opt-in) | 0.80×, 0.80×, 0.78× | ~ 21-26% |
360+ | sequential, memo forced off (mutation-tested) | 0.69×, 0.80×, 0.68× | ~ 25-45% |
361+
362+ The sequential-* no-memo* slowdown is consistently at or above the
363+ sequential-* memo* slowdown, never below it. So most of the typical-word
364+ regression genuinely is the lost thread (both configurations are slower
365+ than parallel-default, by a similar order of magnitude) — but it is not
366+ * purely* that: even on a grammar where the template memo never once
367+ replays, the mrule-cascade's own cache still fires (64 positive / 157
368+ nogood hits on this corpus) and measurably claws back some of the
369+ thread-loss penalty rather than adding to it. Three reps each is enough to
370+ see the direction of the effect, not enough to state a precise recovered
371+ percentage with confidence — a larger repeated-trial run would sharpen
372+ this if the exact number ever matters for the default-flip decision.
373+
374+ ** Is the H2 shortfall actually the deep-clone tax?** Plausible, not
375+ confirmed — resist stating it as established. The one piece of direct
376+ evidence is that H2's memo fired heavily before timing out (tens of
377+ thousands of positive hits on both tables, §5 above) — the memo is
378+ clearly not idle on this word, which favors "replay/clone cost per hit is
379+ what's expensive" over "the memo doesn't engage." But that is a
380+ directional tell, not a measurement: distinguishing "expensive replay" from
381+ "just a lot more raw expansion than H1" requires profiling where memo-on
382+ wall time actually goes (` Clone ` /` Freeze ` /` ReplayOnto ` vs raw rule
383+ expansion) on H2 specifically. Scoped as a follow-up, not undertaken here.
384+
330385## 6. Expected outcome and honest caveats
331386
332387- Pathological template-heavy words: prototype showed ~ 5× (with COW clones). Master's
@@ -342,8 +397,11 @@ the one word measured to completion.
342397 word in 26.9s. If a future heavy-set measurement shows replay cost dominating after
343398 all, this is the evidence that would motivate porting ` Shape ` COW as its own
344399 follow-up — do not fold it into this PR pre-emptively.
345- - Typical words (Indonesian-class) see little change — the memo pays off only where
346- order-variant redundancy exists. The corpus gate proves "no regression" there.
400+ - Typical words (Indonesian-class) get measurably * slower* under sequential+memo
401+ (~ 21-26% in aggregate, §5 addendum) — mostly the cost of losing a thread, not the memo
402+ itself (isolated via a sequential-no-memo comparison, same addendum). The corpus gate
403+ proves "no divergence" there, not "no regression" — this is exactly why the memo ships
404+ off by default rather than flipping the library's default cascade mode.
347405- The memo is inert for ` Ordered ` -strata-only grammars and for ` ParallelCombinationRuleCascade `
348406 (no natural subtree-completion moment in its breadth-first walk — same reason the
349407 prototype left it unmemoized).
0 commit comments