Skip to content

Commit 8711c15

Browse files
olwangclaude
andcommitted
docs(selfhost): record AST-parity progress 121→245/569 (SH-025, plan)
Update the ledger SH-025 entry and the plan doc to reflect this session's AST producer coverage: match, generic-qualified calls, closures, for-loops, object/map literals, unary/negative — corpus reach roughly doubled (121→245 byte-exact, 0 run-failures) via ratcheted milestones. Refresh the covered/residual lists. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ca14e9d commit 8711c15

2 files changed

Lines changed: 45 additions & 30 deletions

File tree

docs/ledgers/rss-selfhost-ledger.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -868,33 +868,41 @@ gap is VM value-representation / intrinsic-dispatch cost (the next big lever).
868868
across all backends; RS0037 removed as a restriction and repurposed for arity;
869869
spec §20.1 amended.
870870

871-
### SH-025 — AST-dump parity: streaming rss producer at 121/563, residual grammar is the growing tail
871+
### SH-025 — AST-dump parity: streaming rss producer at 245/569, residual grammar is the growing tail
872872

873873
- **Context:** step 2 of frontend object parity (after the AST-dump format +
874874
oracle keystone, SH-adjacent). `selfhost/astdump.rss` is a recursive-descent
875875
rss parser that STREAMS the canonical dump (`selfhost/AST_FORMAT.md`); the
876876
harness (`crate::selfhost_parity`) diffs it byte-for-byte against the Rust
877877
oracle over `parse_source_raw`.
878-
- **Reach:** 121 / 563 corpus files byte-exact, **0 run-failures** — the producer
878+
- **Reach:** 245 / 569 corpus files byte-exact, **0 run-failures** — the producer
879879
never crashes; unsupported constructs mismatch (partial/`unknown-*` markers)
880-
rather than panic. Curated `samples/ast/*.rss` (6 files: functions, effects,
881-
control flow, calls, structs+generics+derives+handle fields, sums, module/use/
882-
const/type-alias) are byte-exact and gate non-ignored; `ast_parity_corpus`
883-
(`#[ignore]`) ratchets the floor (currently 121).
880+
rather than panic. 13 curated `samples/ast/*.rss` are byte-exact and gate
881+
non-ignored; `ast_parity_corpus` (`#[ignore]`) ratchets the floor (currently 245;
882+
run in `--release`, ~100s).
884883
- **Covered:** top-level fns (pub/async/native, generic params + bounds, params
885884
with read/mut/take effects, generic-arg types, return type, body); struct/class/
886885
resource (opaque, generics, derives, handle/weak fields, defaults, drop); sum
887886
(variants + fields); const/type-alias/module/use; statements return/let/local/
888-
assign/if-else/while-loop/break/continue/expr; a split-at-last-top-level-operator
889-
expression parser matching the oracle's precedence, plus call (name/qualified/
890-
receiver, named + effect args), field/index, array, try `?`, parens, literals.
891-
- **Residual (the tail):** for-loops, match statements/expressions, closures,
892-
object/map literals, interpolated strings, `!`/`~` unary desugars, negative
893-
number literals, effect-receiver calls (`read x.m()`), fn attributes
894-
(`#deprecated`/`#lower_name`), effect/retains clauses, protocols/impls/
895-
native-modules (they dump in a separate program section, not source order, so
896-
streaming can't place them), and `statement_end` operator/postfix line
897-
continuation. Each is additive; the floor ratchets as they land.
887+
assign/if-else/while-loop/**for**/**match**/break/continue/expr; a
888+
split-at-last-top-level-operator expression parser matching the oracle's
889+
precedence (with generic-`<>` detection so `Deque<Int>.new()` isn't read as a
890+
comparison), plus call (name/**qualified with generic args**/receiver, named +
891+
effect args), field/index, array, **object/map literals**, **closures** `|x| …`,
892+
**match expressions**, **`!`/`~` unary desugars**, **negative numbers**, try `?`,
893+
parens, literals. Patterns: variant/binding/wildcard/literal/struct (fields with
894+
shorthand/`_`/effect/nested, `..` rest).
895+
- **Milestones (this session, each a commit + ratcheted floor):** base fns 58 →
896+
decls 121 → match 178 → generic calls 225 → closures 239 → for+literals 242 →
897+
unary/negative 245.
898+
- **Residual (the tail):** interpolated strings, effect-receiver calls
899+
(`read x.m()` → ReceiverCall), the explicit-`fn(...)` closure form (captures /
900+
declared effects), fn attributes (`#deprecated`/`#lower_name`), effect/retains
901+
clauses, tuple/list patterns, protocols/impls/native-modules (they dump in a
902+
separate program section, not source order, so streaming can't place them), and
903+
`statement_end` operator/postfix line continuation. Remaining mismatched files
904+
typically stack several of these at once (diminishing per-feature ROI). Each is
905+
additive; the floor ratchets as they land.
898906
- **Status:** open (growing tail). The producer + parity gate + risk mitigations
899907
(curated fast gate; module-story decision recorded in AST_FORMAT.md) are in
900908
place; full 556-file byte parity is incremental, tracked by the ratcheting

docs/self-hosting-stress-test-plan.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,25 @@ likely want a sampled fast inner-loop gate plus the full corpus pre-push.
280280
recursive-descent rss parser that STREAMS the canonical dump (no handle-based AST is
281281
materialized). Parity harness: `ast_parity_tiny_sample` + `ast_parity_samples`
282282
(non-ignored, byte-exact vs the oracle over curated `samples/ast/*`) and
283-
`ast_parity_corpus` (`#[ignore]`, ratchets a floor over all 563 files and asserts
283+
`ast_parity_corpus` (`#[ignore]`, ratchets a floor over all files and asserts
284284
**0 run-failures** so a producer crash regresses the gate even if the byte-exact
285-
count still clears the floor). That corpus gate runs the reg-VM over ~560 files and
286-
is slow in a debug build — run it in `--release` for a quick measurement; the fast
287-
non-ignored inner-loop gate is `ast_parity_samples`. Current reach: **121/563
288-
byte-exact, 0 run-failures** (the producer never crashes; unsupported constructs
289-
mismatch rather than panic). Covered: fns (generics/effects/
290-
return/body), struct/class/resource (opaque/generics/derives/handle-weak/defaults/
291-
drop), sum, const/type-alias/module/use, the core statements, and a precedence-exact
292-
expression parser (calls, field/index, array, try, effects, literals). Both risks are
293-
handled: the curated set is the fast inner-loop gate; the module story is decided in
294-
`selfhost/AST_FORMAT.md` (commit to concatenation). The residual grammar (for/match/
295-
closures/object-map/interp/unary-desugars/effect-receiver/attributes/protocols/
296-
line-continuation) is the additive tail, tracked as **SH-025** and gated by the
297-
ratcheting floor.
285+
count still clears the floor). That corpus gate runs the reg-VM over ~570 files and
286+
is slow in a debug build — run it in `--release` for a quick measurement (~100s);
287+
the fast non-ignored inner-loop gate is `ast_parity_samples`. Current reach:
288+
**245/569 byte-exact, 0 run-failures** (the producer never crashes; unsupported
289+
constructs mismatch rather than panic), roughly doubled this session via ratcheted
290+
milestones: base fns 58 → declarations 121 → match 178 → generic calls 225 →
291+
closures 239 → for/literals 242 → unary/negative 245. Covered: fns (generics/
292+
effects/return/body), struct/class/resource (opaque/generics/derives/handle-weak/
293+
defaults/drop), sum, const/type-alias/module/use, statements (return/let/assign/
294+
if-else/while/**for**/**match**/break/continue/expr), and a precedence-exact
295+
expression parser with generic-`<>` disambiguation (calls incl. **generic-qualified**,
296+
field/index, array, **object/map literals**, **closures**, **match-expr**, **unary
297+
`!`/`~`**, **negative numbers**, try, effects, literals) plus variant/binding/
298+
wildcard/literal/struct patterns. Both risks are handled: the curated set is the
299+
fast inner-loop gate; the module story is decided in `selfhost/AST_FORMAT.md`
300+
(commit to concatenation). The residual grammar (interpolation, effect-receiver
301+
calls, explicit-`fn` closures, attributes, effect/retains clauses, tuple/list
302+
patterns, protocols/impls/native-modules, line-continuation) is the additive tail —
303+
mismatched files now typically stack several at once — tracked as **SH-025** and
304+
gated by the ratcheting floor.

0 commit comments

Comments
 (0)