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

The terminal's first boot is paid once per file by the shared test helper, not by whichever test boots first #17572

opened this

Merged 17h 3m ago, live in production

Main's verification went red on two terminal tests over the 2 s CPU budget (#17310): "Enter opens the parked issue, R reads again, a non-admin gets nothing" (2.25 s) and the terminal mirror test (2.16 s, then 3.91 s). It is a class.

Notes

opened this

Main's verification went red on two terminal tests over the 2 s CPU budget (#17310): "Enter opens the parked issue, R reads again, a non-admin gets nothing" (2.25 s) and the terminal mirror test (2.16 s, then 3.91 s). It is a class.

  • The first createForgeApp of a process imports tui/forge_parts.ts: the root, the palette and every screen the palette lists (#17496). That is 448 ms of CPU cold on a Mac. A first boot measured 361 ms; later boots 6 to 19 ms.
  • 509 test files boot the terminal, and 499 of them import test/helpers/tui.ts. Whichever test boots first in each file pays the load inside its own 2 s.
  • test/helpers/tui.ts now registers a beforeAll that imports forge_parts, so each file pays the load once as the file's cost (a test is timed without its hooks). Nothing is loaded that the first boot would not have loaded. Under --no-isolate the module is already there, and it costs nothing.
  • The 3 files that import the helper without booting the forge's terminal (tui-finder, tui-maintenance-quiet, tui-maintenance-reopen) now pay about 450 ms in a hook.
  • "Enter opens the parked issue…": 575 and 647 ms of CPU on the Mac before, 241 and 245 ms after.

A batch of 20 terminal and cross files: 230 pass, 0 fail. Three terminal files under --no-isolate: 10 pass, 0 fail. Under --randomize --seed 9, tui-crewhandover-open fails an order-dependent assertion, the same with main's helper (the class #17505 tracks), not this change.

No door: a test helper; nothing anyone sees changes. Direction: main is green before anything else; the CPU budget (#17310) catches heavy tests.

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