Fast trine run (roadmap #43)

trine run app.tr picks the fastest way to get the answer now, without changing it:

situationwhat happenstypical start-to-finish
this exact program ran beforeits cached native build runs directly, before any parsingjson.tr: 7 ms (was 47 ms interpreted)
new or edited program, short runinterpreted at once; a background process builds it natively for next timejson.tr: 59 ms (same as before)
new or edited program, long runinterpreted at once, then tiered up to the native build when it lands, mid-runfib(35): 0.24 s (was 19 s interpreted)
this file's runs are known to be longcompiled first, then run natively

--interp always interprets (the reference semantics). --native always compiles and waits. --vm runs the ownership-IR VM. Setting TRINE_NO_CACHE=1 turns the cache off, and TRINE_RUN_VERBOSE=1 reports which path a run took.

How it works

Evidence

Honest notes

Update: the VM runs the first phase (P2a)

While the native build is compiled in the background, the program now runs on the ownership-IR VM instead of the tree-walking interpreter: 1.1-2.2x faster on the examples (particles 755 → 338 ms, raytrace 150 → 85 ms), with the same output, the same step counts and the same tier-up points. --interp still selects the tree walker, the reference semantics.