You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 09947d2
Browse filesBrowse the repository at this point in the historyBrowse files
feat(hot-reload): the metadata-delta route is on by default for hot reload workers, with a measured cost and the wire to say so
With the variable on, the whole host tier (312 tests, none failed) and the eight
browser journeys passed, a save to a run_app app is served in 2.6 s on .NET 10
and 1.8 s on .NET 11 against about 7.5 s and 5.8 s for the restart it replaces,
and a loop of 50 million calls costs the same with the process editable
(489 against 481 ms, 444 against 448 ms). SAGEFS_METADATA_DELTA=off is the
way back.
The daemon's lastReload and ReloadReported event now carry the worker's
mechanism (detour, metadata-delta, empty for a verdict that is not a patch) as a
closed set, so a client never has to read it from the words. The fixture gets a
call-heavy route, and RunAppDeltaTests prints the cost (DELTA-COST) with a
tripwire at twice.
The docs say what the route takes, what it refuses and why, what it costs, and
what it leaves undone: the REPL and live tests keep the last build's code until a
restart. Prior art credited to dotnet/fsharp#19941 (Nat Elkins).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016SwvKtCMh6Dg7JAWDof5LS
Copy file name to clipboardExpand all lines: SageFs.Tests/DaemonStateChangeContractTests.fs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ let daemonStateChangeContractTests =
37
37
38
38
testCase "ReloadReported serializes with the owning session ID and what the worker said the save did"<|fun _ ->
39
39
letfacts:ReloadFacts =
40
-
{ Case = ReloadCase.RestartRequired; Patched =0; Considered =2; Message ="restart the app to apply this"; SuggestedAction ="restart"}
40
+
{ Case = ReloadCase.RestartRequired; Patched =0; Considered =2; Message ="restart the app to apply this"; SuggestedAction ="restart"; Mechanism = SageFs.Features.ReloadOutcome.PatchMechanism.NoPatch}
Copy file name to clipboardExpand all lines: SageFs.Tests/PatchConfirmationTests.fs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -235,7 +235,7 @@ let tests =
235
235
236
236
testCase "WHY — the session status carries the new cases under their own tokens, so an agent reading lastReload can tell applied from seen running"<|fun _ ->
237
237
for case, token in[ ReloadCase.PatchPending,"PatchPending"; ReloadCase.NeverEntered,"NeverEntered"; ReloadCase.Patched,"Patched"]do
238
-
letfacts:ReloadFacts ={ Case = case; Patched =0; Considered =2; Message ="m"; SuggestedAction ="a"}
238
+
letfacts:ReloadFacts ={ Case = case; Patched =0; Considered =2; Message ="m"; SuggestedAction ="a"; Mechanism = SageFs.Features.ReloadOutcome.PatchMechanism.NoPatch}
testTask (sprintf "[%s] a process started so it can take a delta runs a call-heavy loop within a small multiple of one that was not"(HostRuntime.moniker runtime)){
eprintfn "DELTA-COST [%s] %d calls of a NoInlining method, n=%d runs after a warm-up: route off %s ms (median %.0f), route on %s ms (median %.0f), ratio %.2f"
(on |> List.map (sprintf "%.0f")|> String.concat ", ")(median on)
391
+
ratio
392
+
(ratio, spinCostBound)|> Expect.isLessThan (sprintf "the route's cost on a call-heavy loop (off %A ms, on %A ms)" off on)
393
+
}
394
+
testTask (sprintf "[%s] what a save costs: file written to new code served, with the build, the diff and the runtime's call apart, against a process start"(HostRuntime.moniker runtime)){
eprintfn "DELTA-COST [%s] of which the build (ms): median %.0f, the diff and the delta written: median %.0f, the runtime's call and its handlers: median %.0f"
eprintfn "DELTA-COST [%s] a restart starts a process on top of the same build: host to app answering %.0f ms, after a build of %.0f ms (one start, measured on this run)"
0 commit comments