Repository navigation
vm: prove wasip1 interprets, not just links - #435
Conversation
|
Two more measurements, which change how the hang reads. It is not single-threading, nor the absence of asynchronous preemption. Neither of the two reproduces natively:
And the most telling signal: Go's For context: The next narrowing requires knowing this code: step markers inside |
The wasip1 lane built the module and ran one snippet through the CLI; the in-package side only ran TestStatSysExtract. Nothing asserted that the VM compiled for wasm actually executes a program end to end. TestRunsAProgramOnThisHost makes the smallest claim an interpreter can make — a program with an observable effect has one — with no fixture and no golden file, so it cannot pass while the VM produces nothing. The wasip1 lane now runs it under wazero alongside TestStatSysExtract, for a couple of hundred milliseconds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8ba3c51 to
35e9463
Compare
This supersedes the framing this PR opened with. There is no wasip1 hang in rbgo. The stall I chased all night was in the host runtime —
wasmer 7.2.1— and the same.wasmfile passes under wazero in 0.07 s. Details below, because the way it was pinned is worth more than the conclusion.What lands
TestRunsAProgramOnThisHost— the smallest claim an interpreter can make: a program with an observable effect has one. Parse, compile, run, look for the string the program printed. No fixture, no golden file, nothing that can stay green while the VM produces nothing.And the wasip1 lane now runs it under wazero, next to
TestStatSysExtract:The lane already built the module and pushed one snippet through the CLI. A build gate proves the module links; it does not prove it interprets. This costs a couple of hundred milliseconds:
— that is the CI step run verbatim on this branch, with the
wazeroCLI CI installs.How the false alarm was pinned
The symptom was real: under wasmer,
rbgo script.rbprinted nothing and exited 0, and this test hung insidevm.New. Narrowing it:GOMAXPROCS=1passes natively in 1.9 s, and withGODEBUG=asyncpreemptoff=1in 1.6 s.-test.timeout 30mon a run left going for 31 minutes produced no panic. That timer is a goroutine, so nothing was being scheduled at all.bootstrap(), validated against a native control run first (215 markers,DONE, 1.4 s).registerBigDecimal,registerDate,registerDigest,registerSocket. A stop point that moves between identical runs is not a bug in the code being run.internal/vmtest binary, 118 MiBrbgo.wasm, 101 MiBThe instructive step is the last one. My control in steps 1–3 was the native build, which cannot catch a host-runtime defect however carefully it is run — when the suspect is an environment, the control has to be a second environment. CI has been using wazero on this lane all along, which is why it stayed green while I hunted a hang only my local wasmer produced.
Nothing about wasmer is actionable here. This PR just makes the lane assert the thing that would have told me sooner.