Move the browser host out of the demo and take only the half ceangal owns - #2
Open
O6lvl4 wants to merge 5 commits into
Open
Move the browser host out of the demo and take only the half ceangal owns#2O6lvl4 wants to merge 5 commits into
O6lvl4 wants to merge 5 commits into
Conversation
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.
Stacked on #1 — review that first.
ceangal's browser host lived in
examples/demo/, so every consumer copied it out of an example. That is how a downstream copy diverged from this repo and the rendering bug in #1 got found and fixed in the copy rather than here. Worse, the copy also contained snaidhm'sgpunamespace implementation: a repo that merely consumes snaidhm owned the only copy of snaidhm's own host.What moves
examples/demo/{ceangal_runtime.js,sdf.js,ttf.js,*.wgsl,font.ttf}→host/, with the runtime renamedruntime.js.The
gpunamespace implementation is removed from this repo entirely. It belongs to snaidhm, which declares it (almide-graphics/snaidhm#3 ships it assnaidhm/host/gpu.js), andruntime.jsnow imports./gpu.jsfrom there. What is left here is the half ceangal actually owns: the frame loop, the DOM overlay, fonts, and ceangal's own shaders.GPU and DOM handles were sharing one table. They are now separate spaces — the wasm side never crosses them, so they never needed to share — and everything GPU-side goes through the host object snaidhm returns.
The demo becomes a consumer
examples/demo/keepsindex.htmland its own assets; the host files are assembled into it and gitignored. So the demo exercises exactly the path a real consumer takes, instead of being the place the source happens to live.Assembling
The toolchain resolves
.almdmodules from dependencies but has no equivalent for web host assets —native/is native-only and hardcoded — so a page still copies these files.tools/assemble-host.mjsmakes that copy mechanical and checkable rather than manual:node tools/assemble-host.mjs examples/demo host ../snaidhm/host node tools/assemble-host.mjs --check examples/demo host ../snaidhm/host # for CIEach package lists its contribution in
host/MANIFEST. The assembler writes.provenancerecording the source commit and hash of every file:--checkfails on drift in either direction, and also on a served file that no package claims — the fork-waiting-to-happen case. Verified falsifiable: appending a line to an assembledruntime.jsproducesand exit 1.
What this does not fix
Consumers still copy. npm (git dependencies work) would version the copy but not remove it, because
runtime.jsfetches./raster.wgsland./font.ttfrelative to the page — those have to land in the served directory either way. With two consumers, ownership plus a drift guard is the part that was actually costing something. A third consumer is the point to revisit packaging.