Repository navigation
Query layer: decision on the query-only WASM module (ADR 0021, M5c) - #100
Merged
Merged
Conversation
…021, M5c, work in progress) arqlet-query-json holds the JSON request and answer of the query operation; the runtime uses it and adds the content revision and the view mapping. arqlet-query-wasm is a prototype module (lw_alloc, lw_free, lw_run) that holds one graph with its payload and answers queries, to measure its size against the engine's. Signed-off-by: Benjamin Becker <hello@engtwin.dev>
Measures arqlet-query-wasm against the engine (1.02 MB, gzip 0.33 MB, against 7.12 MB, gzip 1.84 MB with the query feature), tests it against the oracle through the real WASM file (tools/query-wasm.test.mjs, in CI), and joins it and arqlet-query-json to the isolation guard. The ADR records the decision: the crate stays, an npm package waits for a host that needs it. Updates the specification, the changelog and CLAUDE.md. Signed-off-by: Benjamin Becker <hello@engtwin.dev>
speedcat
commented
Nov 22, 2026
speedcat
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed: mergeable from my side; CI green. Sharing the JSON answer through arqlet-query-json (runtime and module cannot drift), the size measurement (1.02 MB vs 7.12 MB) and the oracle run in CI are good.
Points, none blocking:
- CLAUDE.md now contradicts itself in two places: "Only
wasmand the bins may touch those boundaries" and "crates/wasm: … Only adapter that targets WASM".query-wasmshould be named in both. - MSRV does not cover the new WASM target. The
msrvjob checks only-p arqlet-wasm --target wasm32-unknown-unknown(the rule from 449c97e: check the WASM adapter too); add the same line forarqlet-query-wasm. ItsCargo.tomlalso lacksrust-version.workspace(and the other workspace fields the crates carry). loadcopies the whole graph:serde_json::from_value(v["graph"].clone())holds it twice for a moment. Owning the request and usingv["graph"].take(), or reading it in one pass from the text as the engine'sload_textdoes, avoids that; relevant to the "time to load a large graph" left unmeasured.- Nit: the
loadanswer counts unresolved edges (edges: 2), the query answer does not (graph.edges: 1). Count the same way, or name the difference (unresolved).
…b, workspace fields, load read in one pass CLAUDE.md names query-wasm beside wasm where it says who may target WASM or touch host boundaries. The msrv job also checks arqlet-query-wasm for wasm32, and its manifest carries the workspace fields of the other crates. load is read straight from the request text into its types instead of through a JSON value of the whole request (a test shows it equals the general path), and its answer names the edges a query does not see (unresolvedEdges) so the two counts agree. The module grew by 6 percent with the second reading path; the sizes in the results file, the ADR, the specification and the changelog are measured again. Signed-off-by: Benjamin Becker <hello@engtwin.dev>
Contributor
Author
|
Thanks, all four points taken (7cea020):
|
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 #94 (base
query-executor); retarget tomainafter #94 merges.What it does
arqlet-query-wasm, a query-only WASM module (lw_alloc,lw_free,lw_run):loada graph with its payload,queryit. No layout engine.publish = false.arqlet-query-json, the JSON request and answer of the query operation, shared by the runtime and the module so the two cannot drift. The runtime'squerynow uses it and adds the content revision and the view mapping.benchmarks/results/query-m5c-20261122.md): 1.02 MB (gzip 0.33 MB) against 7.12 MB (gzip 1.84 MB) for the engine with thequeryfeature,wasm-sizeprofile.Checks
tools/query-wasm.test.mjsruns all 40 supported cases ofexamples/cypher/through the built WASM file; all give the oracle's rows. Added to CI.fastprofile), the query tests in the debug profile, clippy (0 warnings), isolation guard, native = WASM parity (13 of 13).Not measured
The share of
arqlet-modelin the module's size, and the time toloada large graph.