Chapters · Chapter 7

GQL: A Language Where Geometry Determines Complexity

Part II — The Engine Room · seven builds, seven receipts

These exercises rerun the chapter's audit at your own keyboard — the worked session against gigi-stream is the template, and every experiment here produces a receipt of the same class: a wire transcript, a parsed/inert/501 row that the status table either does or does not yet contain, a per-verb timing curve in nanoseconds, or a province-to-parser line number map. You are the auditor; the parser is the country.

Run it live — GQL console

Point at the public read-only instance (no key needed) or your own engine (start it with GIGI_CORS_ORIGIN=* for browser access — dev only).

E7.1Reproduce the live session

Build

Stand up gigi-stream from the same working tree the chapter used (cargo run --features kahler --bin gigi-stream), then replay the 2026-06-11 session against POST /v1/gql on localhost:3142 — the BUNDLE sensors, the four Moscow/Lagos SECTIONs, the SECTION AT, COVER ON, CURVATURE, TRANSPORT, INTEGRATE, CAPACITY, REST point query, and the closing COLLAPSE.

Receipt

A wire transcript whose CURVATURE matches the meta block's curvature to IEEE 754 exactness, with the same \(1/(1+K)\) confidence identity I verified in the BLD-SESSION-CONFIDENCE-ENVELOPE receipt — bit-identical, not within tolerance.

Bonus

Add a fifth city, re-run CURVATURE, and watch \(K\) move. Predict the direction first.

E7.2Forge a status-table row

Build

Pick one of the five Parsed-but-inert rows from the book (try ANALYZE or SHOW INDEXES), and a verb the reference marks Implemented (try CURVATURE). Send each over the wire and capture the response.

Receipt

A two-row diff showing the inert verb returning 200 with no observable side effect (compare a follow-up read before and after) versus the implemented verb returning a value the meta block confirms — the same difference between recognizing a sentence and acting on it that this chapter's audit names.

Bonus

Pick a 501 row and confirm the engine returns a definite refusal rather than a misleading success.

E7.3Stress the EMIT silence

Build

Take the BLD-SESSION-EMIT-UNPARSED finding and push on it — append XYZZY GIBBERISH EMIT DHOOM WITH CURVATURE, CONFIDENCE, ROTGUT to a working COVER, then a working SECTION AT, then a working INTEGRATE. Verify the parser silently discards the trailing tokens in each case.

Receipt

Three pairs of identical row sets — with-trailing-junk and without — and a grep -c EMIT src/parser.rs that still returns 0. The receipt is that the parser reads one statement and stops, the same finding the chapter's audit prints.

Bonus

Open a draft patch that adds an EMIT production to src/parser.rs and makes the unparsed-tokens case a hard parse error. Do not ship it — I want to see the diff.

E7.4Time SECTION AT and COVER ON yourself

Build

Build three bundles at \(N \in \{10^3, 10^4, 10^5\}\) records, half the rows in one indexed city, the rest spread across seven others — the BLD-SESSION-COMPLEXITY-SCALING harness layout. Time SECTION AT across 200 distinct keys per size and COVER ON across 50 reps, release profile.

Receipt

A three-row table of medians in ns/call that grows roughly \(1.6\times\) for SECTION AT across the hundredfold \(N\) growth, and a per-result COVER ON cost that drifts about \(2.2\times\) across the same range — the shape the book promises, with your machine's constants instead of mine.

Bonus

Plot \(|r|\) vs. wall time for COVER ON at fixed \(N\) by varying the indexed-city fraction; confirm the slope is linear before you trust the contract.

E7.5Refute the REST/GQL EXPLAIN drift

Build

Send the same mixed query — indexed city plus fiber predicate on temp — to two endpoints back to back: POST /v1/bundles/sensors/explain (the REST handler at gigi_stream.rs:10761-10817) and a GQL EXPLAIN statement through /v1/gql. Capture both responses verbatim.

Receipt

REST returns the scan_type: "index_scan + filter" plan with index and filter legs separated; GQL EXPLAIN returns a bare Ok — the four-line placeholder at src/parser.rs:7024-7027. Your two transcripts are the BLD-SESSION-EXPLAIN-REST-PLAN drift the audit caught, reproduced.

Bonus

Open a TODO on the placeholder pointing at the REST handler — the work order is one function call away.

E7.6Wire a province to a parser line

Build

Pick three of the ten provinces named in section “The verbs and who they came from” — say Patterns (SCJ-Hunt), Transport (Marcella/K\"ahler L1–L9), and Encryption (Sprints H/N/O/P/Q). For each, open the cited parser line, run git blame on it, and walk to the corresponding spec file in theory/scj/, theory/kahler_upgrade/, and theory/encryption/ respectively.

Receipt

A three-row table: parser line \(\to\) verb \(\to\) spec file \(\to\) commit SHA \(\to\) owner team. Each row reproduces one province's lineage end to end — no guesses, all sources cited in the chapter.

Bonus

Pick a verb the reference does not yet name (DEFINE, HUNT, PERCEIVE, SAMPLE_TRANSPORT) and draft the four-line reference-table row it deserves — feature column, status column, notes column, source-file pointer.

E7.7Replay the WISH antipode test

Build

Hit /v1/wish (gated by #[cfg(feature = "wish")] at src/bin/gigi_stream.rs:14472-14473) with the \(W_2\) antipode configuration the SCJ co-review singled out — destination at the antipode of a sphere where every meridian is a minimizing geodesic. Then re-run with the destination an \(\varepsilon\) off the antipode.

Receipt

The antipode call returns Indeterminate (the verdict structure refusing to confabulate at the place lying would be most tempting); the perturbed call returns Granted with a unique geodesic. Two responses, one verdict trichotomy, the cleverest acceptance gate the SCJ team named.

Bonus

Run the theory/imagine/validation/wish_sudoku_experiment.py bottleneck Sudoku and confirm WISH picks a value on the joint probability-simplex manifold rather than guessing — the boundary-value answer where the initial-value siblings would have shrugged.

← Chapter 6 exercisesChapter 8 exercises →