mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-21 15:42:58 +01:00
Answer prose round 1: 0 🔴, 4 🟡 (0 misread); retitle and rewrite the cap's entry, measure the changelog against 0.2.0
This commit is contained in:
@@ -75,7 +75,7 @@ In `docs/decisions.md`:
|
|||||||
- No value `JSON.parse` or `structuredClone` builds loops a call
|
- No value `JSON.parse` or `structuredClone` builds loops a call
|
||||||
- Nothing spreads an unbounded array
|
- Nothing spreads an unbounded array
|
||||||
- A retry loop checks its own termination
|
- 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
|
- Readers scan by index
|
||||||
- The spelling memo
|
- The spelling memo
|
||||||
- Cost fixes are measured, never timed
|
- Cost fixes are measured, never timed
|
||||||
|
|||||||
+4
-4
@@ -62,10 +62,10 @@
|
|||||||
strong: text `un` beside `-r` marked em and strong, repeated 1000 times, took up to 9 seconds,
|
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,
|
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
|
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
|
with strong takes time linear in its length: `~~` between spaces marked em and strong, `)` marked
|
||||||
and strong, `a`, then `.unun` marked strike and strong, repeated 1000 times, took 33 seconds in
|
em, strike and strong, `a`, then `.unun` marked strike and strong, repeated 1000 times, took 56
|
||||||
`adfToLosslessMarkdown` and 39 in `adfToPortableMarkdown`, now 2.6 and 1.5 seconds. A line whose
|
seconds in `adfToLosslessMarkdown` and 130 in `adfToPortableMarkdown`, now 2.6 and 1.5 seconds. A
|
||||||
emphasis still reads back wrong after 32 tries is written with every node holding em, strike or
|
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
|
strong as `!adf:carry{json="…"}` in `adfToLosslessMarkdown`, and without those marks in
|
||||||
`adfToPortableMarkdown`.
|
`adfToPortableMarkdown`.
|
||||||
- `adfToLosslessMarkdown` and `adfToPortableMarkdown` take time linear in the markdown when lists
|
- `adfToLosslessMarkdown` and `adfToPortableMarkdown` take time linear in the markdown when lists
|
||||||
|
|||||||
+11
-7
@@ -908,17 +908,21 @@ fine.
|
|||||||
A loop retrying an input until a fallback spells it refuses the pass taking no fallback, so its
|
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.
|
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
|
2026-10-30, the maintainer. Goals 9 and 1. Valid while a writer finds a misread run only by reading
|
||||||
the line back.
|
the line back.
|
||||||
|
|
||||||
The lossless and portable writers read a line back after each fallback, and the sweep takes back
|
Each pass, the lossless and portable writers spell the line, read it back, and fall back on the
|
||||||
the misread pairs it can prove fall together. Where a strong opener captures the `*` em leaves over,
|
first misread emphasis run and on every run `unspellableRuns` proves falls with it: the lossless
|
||||||
the sweep can't predict it, so one pass took back one strong, and a line of 1000 such repeats took
|
writer carries the run's nodes, and the portable writer drops its mark. When em and strong share a
|
||||||
33 seconds. After 32 passes the line takes back every em, strong and strike run at once: the
|
delimiter run, as in `***`, and the strong closes first, the next strong opener can pair with em's
|
||||||
lossless writer carries every node holding one, and the portable writer drops those marks. That
|
leftover `*`. `unspellableRuns` can't foresee that pairing, so each pass falls back on one strong,
|
||||||
line keeps fewer marks than the pass-by-pass result would, in exchange for time linear in the line.
|
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
|
## Readers scan by index
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user