Repository navigation
asio: the worker page, tests and texts under the -O3 release link - #4
Merged
Merged
Conversation
The superproject links an emscripten program at its compile's level of optimization (webcpporg/webcpp#18), -O3 in a release build. browser_worker_move_failure never polls, and its -O3 link drops webcpp_asio_main_poll and Emscripten's doPollAsync with it, so worker_page.html threw "missing pinned SDK doPollAsync" in preRun. The page now exempts it from the poll watch, as run.mjs exempts it from the poll check and the page already exempted the pthread return probe. bridge_optimized_link_exceptions_on/off and asyncify_stack_optimized_link_* linked release with <linkflags>-O3, which release now does itself: their .wasm files are byte-identical to the release builds', and their .js files differ only in the program's name. asyncify_stack keeps its debug and release builds. The bridge's two are kept, without the flag, as bridge_release_exceptions_on/off: the emscripten lane builds debug, and they are the bridge's only release build there, whose link drops the stack helpers the bridge's JavaScript calls unless asio exports them. Measured again with asyncify_stack (Emscripten 6.0.11): debug, now the deepest build, wrote at most 1,168 bytes with exceptions and 848 without; release 388 and 304. With a 2048-byte stack no test of the asyncify lane trapped in debug or release, so the 2026-10-11 rule alone would now give 4096. The size stays 8192, the default and the floor that the libraries built on asio and their programs are tested against; build.jam, AGENTS.md and the guide say why, with the new numbers, and Cobalt's probe's. The README and the testing guide build release sizes with variant=release alone, and no text says b2 links a release build without optimization.
…se builds' measure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: asio: the worker page, tests and texts under the -O3 release link
The superproject now links an emscripten program at its compile's level of optimization (webcpporg/webcpp#18):
-O3in a release build. This brings asio's browser worker page, its tests and its texts to that link.Changes
test/browser/worker_page.html.browser_worker_move_failurenever polls, so its-O3link dropswebcpp_asio_main_polland Emscripten'sdoPollAsyncwith it, and the page'spreRunthrewmissing pinned SDK doPollAsync. The page now exempts the program from its poll watch, asrun.mjsexempts it from its poll check (and as the page already exempted the pthread return probe). With the old page, the releasebrowser-worker-exceptionslane fails in both variants; with the new one, it passes.test/Jamfile.asyncify_stack_optimized_link_*andbridge_optimized_link_exceptions_*linked release with<linkflags>-O3, which release now does itself: their.wasmfiles are byte-identical to the release builds', and their.jsfiles differ only in the program's name.asyncify_stackkeeps its debug and release builds. The two bridge tests stay, without the flag, asbridge_release_exceptions_on/off: the emscripten lane builds debug, b2's default, and they are the bridge's only release build there, where the link drops the native stack helpers the bridge's JavaScript calls unless asio exports them.asyncify_stack(Emscripten 6.0.11), debug is now the deepest build: at most 1,168 bytes with exceptions and 848 without, against 388 and 304 in release. With a 2048-byte stack no test of the asyncify lane trapped in debug or release, so the 2026-10-11 rule alone would now give 4096. The size stays 8192: it is the default and the floor that the libraries built on asio and their programs are tested and measured against, and lowering it would make a program whose frames fit only the larger stack trap at run time.build.jam,AGENTS.mdand the guide restate the reason with the new numbers;AGENTS.mdanddoc/cobalt.adocadd Cobalt's probe (1,036 bytes in debug, 384 in release).README.mdanddoc/testing.adocbuild release sizes withvariant=releasealone, and say how another level reaches both the compile and the link;doc/building.adoc,doc/cobalt.adocandAGENTS.mdno longer say b2 links a release build without optimization. One changelog line.Decision for the owner
Lowering the default Asyncify stack to 4096 is now possible by asio's own tests alone. It is left at 8192 here; doing it would be a breaking change of its own, measured across Cobalt, Beast and Trystero (Trystero's debug room test saves 2,344 bytes on its webrtc branch, more than half of 4096).
Verification
Local, macOS arm64, Emscripten 6.0.11, Node 26.13.0, each lane from scratch (
b2 -a) in its own build directory, with the CI's options, invariant=releaseandvariant=debug, verdict bytools/report/report.py; the browser lanes with chrome-headless-shell 1248:libs/asio/test libs/asio/example): passed, release and debug (113 tests and examples).b2 -a libs/asio/doc: passed. The superproject'stools/lint/lint.sh: clean.No CI was run.
Depends on webcpporg/webcpp#18 (merged).
🤖 Generated with Claude Code