@@ -275,7 +275,7 @@ export interface GenOptions {
275275 fuzzRounds ?: number ; // budget (cap) on systematic-coverage rounds — DETERMINISTIC choice vectors, not random
276276 seed ?: number ; // NO-OP, retained for back-compat: the generator is a pure function of the grammar
277277 nestDepth ?: number ; // self-recursive nesting depth
278- timeBudgetMs ?: number ; // wall-clock cap for the depth strategies (large token-stream grammars )
278+ timeBudgetMs ?: number ; // NO-OP, retained for back-compat: generation is deterministically work-capped (a wall-clock budget made the gate load-dependent )
279279}
280280
281281class Walker {
@@ -1204,13 +1204,14 @@ export function generateInputs(grammar: CstGrammar, opts: GenOptions = {}): GenI
12041204 const matOpts : MatOptions = { mode, indentStep : 2 } ;
12051205 const entry = grammar . rules [ grammar . rules . length - 1 ] ;
12061206
1207- // wall-clock budget: the depth strategies (nest / dirnest) over a LARGE token-stream grammar (the
1208- // TS family — 50+ self-recursive rules, huge Pratt-expression alts) are heavy and add little, since
1209- // those grammars have no indent/markup depth bugs for the scope≡role check to find. Cap total time
1210- // so one driver stays tractable across all 7 languages; each per-rule loop checks it.
1211- const t0 = Date . now ( ) ;
1212- const timeBudgetMs = opts . timeBudgetMs ?? 9000 ;
1213- const timeUp = ( ) => Date . now ( ) - t0 > timeBudgetMs ;
1207+ // NO wall-clock budget: every strategy below is bounded by DETERMINISTIC work caps
1208+ // (enumTop's budgetCalls, coverRounds, maxInputs, per-token sample counts), and the
1209+ // depth strategies only run for indent/markup grammars at all (depthMatters) — the
1210+ // whole 7-grammar sweep measures ~5s on a calm machine, worst single grammar ~4s.
1211+ // A Date.now() budget USED to sit here and made the GATE load-dependent: under a
1212+ // saturated machine the yaml depth strategies got cut mid-walk, the #23/#24 witness
1213+ // shapes silently vanished from the corpus, and mustCover failed with no code change
1214+ // anywhere. A correctness gate must be a pure function of the grammar.
12141215
12151216 const seen = new Set < string > ( ) ;
12161217 const out : GenInput [ ] = [ ] ;
@@ -1266,7 +1267,6 @@ export function generateInputs(grammar: CstGrammar, opts: GenOptions = {}): GenI
12661267 // 2) bounded-exhaustive ROOTED at each self-recursive rule: exercises every rule's own small shapes
12671268 // (round-tripped against that rule as the entry), incl. the FIRST level of self-embedding.
12681269 for ( const rn of recursive ) {
1269- if ( timeUp ( ) ) break ;
12701270 const r = w . ruleByName . get ( rn ) ! ;
12711271 for ( let d = 1 ; d <= Math . min ( nestDepth , 3 ) ; d ++ ) for ( const ems of w . enumTop ( r . body , d ) ) push ( ems , `nest:${ rn } @${ d } ` , rn ) ;
12721272 }
@@ -1275,7 +1275,6 @@ export function generateInputs(grammar: CstGrammar, opts: GenOptions = {}): GenI
12751275 // inner sibling) at depth 1..N — monogram#24 is a BlockSequence inside a BlockSequence with an
12761276 // inner sibling (`- - a\n - b\n- c`), which the un-biased capped enumeration starves.
12771277 for ( const rn of recursive ) {
1278- if ( timeUp ( ) ) break ;
12791278 const r = w . ruleByName . get ( rn ) ! ;
12801279 for ( let d = 1 ; d <= nestDepth ; d ++ ) push ( w . nestChain ( r . body , rn , d ) , `dirnest:${ rn } @${ d } ` , rn ) ;
12811280 }
@@ -1293,7 +1292,6 @@ export function generateInputs(grammar: CstGrammar, opts: GenOptions = {}): GenI
12931292 const COVER_BASE = 4 , COVER_DIGITS = 4 , ROTS = [ 0 , 1 , 2 ] ;
12941293 for ( const ch of coverSchedule ( COVER_BASE , COVER_DIGITS , coverRounds , ROTS ) ) push ( w . cover ( entry . body , depth + 2 , ch ) , 'fuzz' , entry . name ) ;
12951294 for ( const rn of recursive ) {
1296- if ( timeUp ( ) ) break ;
12971295 const r = w . ruleByName . get ( rn ) ! ;
12981296 for ( const ch of coverSchedule ( COVER_BASE , COVER_DIGITS , Math . ceil ( coverRounds / 8 ) , ROTS ) ) push ( w . cover ( r . body , depth + 2 , ch ) , `fuzz:${ rn } ` , rn ) ;
12991297 }
@@ -1306,7 +1304,6 @@ export function generateInputs(grammar: CstGrammar, opts: GenOptions = {}): GenI
13061304 // on the 50-rule TS grammar and needs no depth budget. The samples are guard-filtered (sampleVariants
13071305 // skips the leading-literal embeds for decimal-/anchor-led tokens, so `0x1F` is never mangled to `-0x1F`).
13081306 for ( const tok of w . coverableTokens ( entry . name ) ) {
1309- if ( timeUp ( ) ) break ;
13101307 // CLEAN samples only (no interesting-literal embeds): tokenCover's job is to make the token APPEAR in
13111308 // a legal context, not to stress boundary collisions — that is the enum/fuzz strategies' role, where
13121309 // the embed belongs. Prepending a boundary sigil to a sigil-led token (`<` + `#name`, `>` + `@name`)
0 commit comments