4 Commits
Author SHA1 Message Date
lucioandClaude Fable 5 bc533c6cb1 The clocking wave: eight buckets in one round, 43 -> 11 on opentitan
ci / checks (push) Successful in 56s
ci / corpus (push) Successful in 22s
Clocking signal bindings (the one production the modelled node was
missing), default disable iff captured verbatim with six rejection
pairs, iff on event-control terms, indexed bare event names
(chain-charged), gate drive strengths (the mop-up's amortized skip),
program blocks as modules with a different closer, and macros as a
concurrent assertion's whole action — where QA caught a real
regression (a macro BEGINNING a statement, four UVM-idiom shapes) and
the rework moved the decision to the token after the call:
at_statement_tail, one line, with the failure asymmetry argued in the
doc and attacked by QA against the diff rather than trusted. Chain
limit 256 -> 1024 on measured need (567 links in pinmux_reg_top) with
PARSE_STACK_SIZE 16 -> 32 MiB restoring the 3.3x margin, a sabotage
probe proving it real, and parse_sens_list's uncharged chain loop
closed. Whole-tree superset: exactly one output move, ~55 lines of
prim_sync_reqack generate code freed from an assertion's opaque
bytes. Corpus 860 files byte-identical, 813/820. The 11 remaining:
macro fragments (preprocessing decision), vendor non-SV (exclude
patterns recommended), three written-up skips.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-29 18:46:58 -07:00
lucioandClaude Fable 5 d4eb8f48ff The stack fits the nesting limit by construction, on every thread
ci / checks (push) Successful in 42s
ci / corpus (push) Successful in 19s
MAX_NESTING_DEPTH turns over-deep input into a parse error only on a
stack big enough to reach level 64, and that was an unenforced README
assumption: debug frames drifted to ~94 KiB/level under rustc 1.97
(worst family nested case, 5.9 MiB at the limit), so a default 2 MiB
spawned thread aborted around level 30 with the limiter never firing.
New vlog_parser::PARSE_STACK_SIZE (16 MiB, 2.7x the re-measured worst
case) is applied at every parse-reaching site: both binaries' work
moved onto named spawned threads (a main stack is the OS's to size —
1 MiB on win32; pre-fix lucisv aborts under ulimit -s 1024, fixed one
diagnoses), rayon pool workers resized, forwarder and lsp-server IO
threads audited parse-free. Deep-nesting suites across four crates on
controlled stacks, sabotage-verified; caller-side stack contract added
to every public parse entry point's rustdoc. analyze measured at
71 KiB on a max-legal tree — no second bound needed.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-28 16:26:06 -07:00
lucio eeaffafd56 Rename the tool to lucisv (Language Utility for Coding In SystemVerilog) 2026-08-25 23:36:00 -07:00
lucioandClaude Fable 5 a49131fc5f Add recursion-limit: bounded parser depth and AST chain length
Two budgets, both measured rather than guessed: MAX_NESTING_DEPTH=64
gates the five recursion cycles in the parser (debug frames run to
~50KB; 64 peaks at ~3.9MiB against the 8MiB stack), and
MAX_CHAIN_LENGTH=256 charges postfix segments and binary/inside
operators, whose loops deepen the AST without parser recursion.
Restore-by-assignment makes the chain budget correct on every early
return. Invariant: AST depth on any root-to-leaf path <= 64+256,
so the formatter's structural recursion is bounded too.

Deep or chain-heavy inputs now get a clean "nesting too deep" /
"expression chain too long" parse error with position, exit 2, batch
unaffected -- replacing an uncatchable stack-overflow abort that
killed whole runs (3KiB of a.b.b... sufficed before).

Round 1 was rejected in review: QA found postfix chains ungated and
the leak test unable to detect missing releases (proven by sabotage).
The rework widened the finding to binary/inside chains, added the
second budget, and made leak tests sabotage-complete (7/7); re-QA
attacked the additive-composition invariant and found no hole, with
no acceptance regressions (128-term sums, 10k statements still fine).

Dev + rework: Opus agent; QA + re-QA: Sonnet agent; full history in
docs/features/recursion-limit/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-19 01:20:38 -07:00