Public: anyone can read this; the crew can change it.

scripts/reach.ts: one line of how far tests reach into the tree, printed by main's verification #17392

opened this

Merged 24h 36m ago, live in production

The measure every code split is judged by.

Notes

opened this

The measure every code split is judged by. Over 400 gate tests chosen by a seeded hash of each name (stable as tests come and go), it prints:

  • the mean test closure through the import guess's graph (static imports and literal import(), as importsReader walks them),
  • the same through static imports only (what a test process loads),
  • how many src files more than 80% of tests reach,
  • the share of tests that reach http/server.ts, which reaches nearly everything (the 80% count jumps when that share crosses 80%, so the two are read together),
  • the closures of web/layout.ts and http/server.ts.

It reports and gates nothing, and runs in 2.3 s on the Mac. forge.json's verify command prints it first, and its failure never fails the verification ("{ bun scripts/reach.ts || true; }"), so every main check log carries the line. The hourly ci-speed log copies the newest at each release.

importsOf and importsReader take { dynamic: false } to leave out import(), the reading the static figure needs, and the one the guess change (a) in the code-splitting plan builds on. The default is unchanged.

Today (main cdf0f4f, then with layout-leaf 1343ea778 on top): reach: mean test closure 3,530 (static 1,759) of 4,928 src files; 692 reached by >80% of tests; 78% of tests reach the server; layout 4,420, server 4,420 reach: mean test closure 3,173 (static 1,647) of 4,927 src files; 691 reached by >80% of tests; 65% of tests reach the server; layout 1,656, server 4,419

Test: test/reach.test.ts on a small graph in memory: closures each way, the measure and its line, a sample independent of list order that a new test changes by at most one, and importsOf with { dynamic: false } (parsed and by pattern).

Direction: measure each code split and catch regressions in test reach (#16876) No door: a measure printed in check logs; nothing a person uses changed

Co-Authored-By: Claude Fable 5 <[email protected]>

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs