Repository navigation
Conversation
…uest shape node-http-calls-what-another-file-laid-over-a-method-of-a-request.test.ts read only stdout of plain Bun, and stdout and the exit code of the compiled program. Plain Bun and the compiled program must now each give the whole result of a run: `called 2` on stdout, one DeprecationWarning with its hint line on stderr, exit code 0 and no signal. The expression for stderr leaves open the number of the process and the name of the executable.
|
Status: ready for a maintainer. This PR is #48723. The diff is green on every lane that ran. CI on 0032206 (build 140691, finished):
How the numbers in the body were made:
|
|
Updated 11:05 AM PT - Nov 12th, 2026
❌ @robobun, your commit 0032206 has some failures in 🧪 To try this PR locally: bunx bun-pr 48723That installs a local version of the PR into your bun-48723 --bun |
|
No actionable comments were generated in the recent review. WalkthroughThe test now checks plain Bun and AOT execution against the same expected stdout, exit code, signal, and deprecation warning on stderr. ChangesAOT HTTP call test
Suggested reviewers: Merge Risk:
|
|
The diff of this PR is ready. I cannot repeat
The |
Problem
test/aot/node-http-calls-what-another-file-laid-over-a-method-of-a-request.test.tsreads only stdout of plain Bun, and stdout and the exit code of the compiled program. A run that warns twice or writes another line to stderr passes. So does a plain run that exits with 3.Fix
called 2, oneDeprecationWarningwith its hint line on stderr, exit code 0 and no signal.bun bd testof the file takes 1,058 s, before 1,295 s and 670 s. In each run the debug compiler crashes in 12 to 16 of the 36 builds (AOT: debug/ASAN compiler crash in LinkFlow::findWhatSomeLaneWasGiven #48169). 36 pass on release builds, one with ASAN.Background
pushon the prototype of an heir ofhttp.IncomingMessage. The other serves one request and counts the calls of that function.pushof its class (src/js/ahead-of-time/node/_http_incoming.ts:1173).node:_http_incomingfor 9 of the 36. A shape would not run there as it runs alone.AOT_PROGRAMS_ALONE, a switch for the whole tree): 8% less CPU time with ASAN.Notes
What the file starts. 36 builds, 36 runs of plain Bun and 36 runs of what was built. This PR changes none of them.
CI, the file as on
main. Seconds, from the logs of thetest-bunjobs of ten builds of other pull requests (2026-11-11 and 2026-11-12). ByrunsOnThisLane()ofscripts/runner.node.tsno other lane runs the file.--max-concurrency=8.--max-concurrency=4.Why still 36 builds.
test/aot/README.mdsays to use one build for many cases, and to keep one case to a program where a case can change what the compiler knows about the others. Here it can.BUN_JSC_aotMapFilePath. The map lists every compiled function with its size and its operations. A build has 4,830 functions, 4,816 of them outside the two files of the shape.Ask.prototype.push = o,Object.assign,util._extend,Reflect.set, a value byObject.definePropertyorObject.defineProperties,const held = Ask.prototype; held.push = oObject.entries(), the key'' + unseen('push')node:_http_incoming,internal:http,internal:http1_server_fallback, the streams__defineGetter__Object.definePropertyObject.keys()internal:util/inspect,internal:primordialsendsItsBodyUnwatched,takeBodyData,endBodyandkeepsItsMethodsofnode:_http_incoming,onHttp1BodyandonHttp1MessageCompleteofinternal:http1_server_fallback,addChunkofinternal:streams/readable.Ask. One program for them holds three classes, or one class with seven stores, and the file asks about one class with one store.Assertions, before and after.
built(): exit code 0 and no line of stderr that begins witherrorcalled 2DeprecationWarning: mand the hint line below it, and nothing elsecalled 2expect()calls: 108, as before. Each of the two for the runs now compares the whole result ofspawned().Snapshot matchers are not supported in concurrent tests,src/runtime/test_runner/expect.rs:1417).A fault made by hand, in 4 of the 36 shapes, on the release build:
mainWhere the time goes. Linux x64, a VM with 12 processors and 16 GB that shares its host. All binaries are built from 7f964e6, the parent of this branch when it was measured. The branch is on ccb3611 now, and neither the file nor a helper that it imports differs between the two. On the release build of ccb3611 the file passes too: 36 pass.
bunofbun-linux-x64.zipthat the build ofmainat 7f964e6 made (140544). Started asscripts/runner.node.tsstarts the file: its environment, aTMPDIRof its own, 4 processors (taskset),--max-concurrency=4. The file takes 33 s to 48 s and about 120 s of CPU time: 3.3 s for each shape. CI takes 45 s there, beside another file.bun scripts/build.ts --profile=release-asan, stripped withllvm-strip --strip-debugas the runner strips it (616 MB). One build on one compiler thread takes 15.3 s and 15.9 s (12.0 s to 12.7 s of user time): 0.7 s to bundle, 2.2 s to check, 13.0 s to compile. Plain Bun runs the program in 0.74 s, the executable runs in 0.26 s.--max-concurrency=8, the 36 builds take 1,545 s of the 1,731 s that the steps of all cases take together: 89%. The runs of plain Bun take 115 s and the runs of the executables 71 s.Builds that write no copy of Bun: measured, not in this PR. With
BUN_AOT_WRITES_PROGRAM_ALONE=1a build writes the program with a launcher at its head, and not a copy of Bun with the program behind it (test/aot/harness/program-alone.ts).test/aot/run-parallel.tsbuilds the stored programs so.main/proc/stat. It does not count the time that the host takes from this VM. With ASAN that time was 0.4 to 2.4 times the CPU time of a run, so the times of two runs do not compare.AOT_PROGRAMS_ALONE=1around a run is that switch for every file oftest/aot. It is off in CI.Plain Bun beside the build: measured, not in this PR. A case can start its plain run while its build runs. On the release build the file then takes 33.7, 36.0 and 37.4 s, and 36.0, 32.9 and 35.3 s with the program alone too. That is the same as without. The processors are busy with builds either way.
bun bd test. A debug build at 7f964e6, the time thatbun testprints. A Bun with ASAN has 5 cases under way.mainmainAddressSanitizer: SEGV on unknown address 0x000000000008inWTF::removeIterator, thenStopped while compiling in scan and Link.That is AOT: debug/ASAN compiler crash in LinkFlow::findWhatSomeLaneWasGiven #48169, which says that only an engine built withoutNDEBUGhas it. The release build with ASAN did not crash in 13 runs of the file here. The one other red case is a build of run 3 that was ended at its limit of 240 s.What I could not run. macOS and Windows. CI runs the file on the three Debian lanes only.