Skip to content

Commit d3a3d99

Browse files
claudehyperpolymath
authored andcommitted
migrate(C11): UI/accessibility coprocessors — NO_NEW_BRAINS (all senses)
All 10 C11 files are host-side senses. DualAlert integer brain was already extracted in C6 (DualAlert.affine, 613/613 parity, LOSSLESS). ForceLayout is a float-only physics wasm (f64 kernel, float-wall). The remaining 8 UI components (Button, HubButton, NavButton, Label, VolumeSlider, InventoryUI, HardwareWiring, DualAlertCoprocessor) are pure PixiJS/PixiUI senses. Ledger and worklist updated; NEXT: C9. https://claude.ai/code/session_01WoKhFQePiRsAj7aqnxbG8s
1 parent 182ae89 commit d3a3d99

3 files changed

Lines changed: 109 additions & 3 deletions

File tree

proposals/MIGRATION-PLAN.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,9 @@ Heuristic:
195195
| C2 wave 2a | DONE | Scalar multiply/divide (2026-06-05, Opus). `Mul`/`Div` turned out to be pure *scalar* value-transforms (not memory ops), so they need *no* array ABI — split out of "wave 2" and landed now. *1 kernel* `VmMulDiv` (11 exports) under `proposals/idaptik/migrated/`. Brain = the reversible ancilla multiply (`c := c + a*b`, inverse `c := c - a*b`) + the quotient/remainder divide whose dividend is reconstructable (`q*b + r == a` for all b incl. 0); the intentional-flaw in-place/simple variants migrated as value transforms with no rt==id claim. *Four gates green:* 1/1 compile, *3322/3322 parity* (incl. mul reversibility roundtrip + div reconstruction), G3 n/a (numeric transform), 1/1 assail-clean. *2 new i32 ABI facts:* (a) JS `a*b` loses precision >2^53 → oracle must use `Math.imul` to match `i32.mul`; (b) `i32.div_s` TRAPS on `b==0` and `INT_MIN/-1` (ReScript wraps the latter) → brain guards both (nested-`if`, avoiding the unverified `&&` codegen path) so the wasm is total. Evidence: `migrated/EVIDENCE-C2-wave2a.adoc`. NEXT: C2 wave 2b.
196196
| C2 wave 2b | DONE | Memory/stack/port/control opcodes (2026-06-05, Opus). *The "needs an array/linear-memory ABI" premise was WRONG and re-decomposition overturned it:* reading the sources, the VM's memory/stack/port buffers are not arrays in the brain — `VmState.res` stores every one as string-keyed dict slots (`_mem:N`, `_s:N`, `_pin:port`), i.e. host-side STATE (senses). The integer brains are all scalar. *4 kernels* `VmMemory` (LOAD/STORE), `VmStack` (PUSH/POP), `VmPort` (RECV/SEND), `VmControl` (IF_POS/IF_ZERO/LOOP) covering *9 opcodes*. *Four gates green:* 4/4 compile, *1568/1568 parity* (incl. load/store/sp/recv/send round-trips), G3 n/a (transforms/predicates), 4/4 assail-clean. No-kernel senses (classified, not migrated): Call (orchestration), CoprocessorCall (tombstone — never implemented), State/VmState/VM/SubroutineRegistry/VmStateCoprocessor/InstructionCoprocessor (state containers / bridges). Evidence: `migrated/EVIDENCE-C2-wave2b.adoc`. *No array ABI was required* (the blocker was a triage-bucket artefact). *Cluster C2 COMPLETE.* NEXT: C3.
197197
| C3 | DONE | Coprocessor wiring layer (2026-06-05, Opus) — *classified, no new brains to extract.* C3's 17 `src/shared/` files are the host-side bridge layer that exposes C1's already-migrated wasm brains to the game engine. Verified de-dup (by constant, not name): the integer cores C3 needs (`compute_gate`/`data_limit_for_domain` 513/16/259/1024, `max_concurrent_compute` 10, `is_transient` 503/504/429, policy table, DeviceType/GameEvent ordinals) are *all* already migrated + 4-gate-verified in C1. The 12 `*Coprocessor.res` are pure-FFI passthrough (0 logic lines); `Kernel_Compute`/`RetryPolicy` (src/shared) are async/float wrappers over C1 brains; `DeviceType`/`GameEvent` add string-gated ops (string wall, Phase F). No 4-gate run (nothing new to verify). Bridges stay host-side as the essential wasm-loading glue (ADDITIVE, FeaturePacks-flagged); their ReScript→glue fate is a Phase-Ω cutover decision. Evidence: `migrated/EVIDENCE-C3.adoc`. NEXT: C5.
198-
| C5 | DONE | Engine coprocessors (2026-06-05, Opus). *2 integer brains extracted + 9 senses classified.* `Maths` (clamp/lerp-milli/dist_sq — float-wall convention, sqrt host-side) and — the strategic one — `Random`, the deterministic **xmur3 + mulberry32 PRNG**, the multiplayer-reproducibility backbone (host iterates the seed string + does the final u32→[0,1) float div; brain owns the i32 mixing). *Four gates green:* 2/2 compile, *2108/2108 parity* (Random **bit-exact** vs the JS source over the full i32 domain + UTF-16 code units, incl. the `>>>` emulation + signed-i32 multiplier constants), G3 n/a (transforms/mixing), 2/2 assail-clean. Senses (classified, not migrated): 5 `*Coprocessor` FFI bridges, Resize/GetResolution (float+DOM), Audio (Pixi), Navigation (screen-stack orchestration + async asset load, effect-gated), WaitFor (timing). Evidence: `migrated/EVIDENCE-C5.adoc`. NEXT: C11.
199-
| C9..C12 | TODO | Remaining clusters per `migration-map.json`: *C11 (10, "pure integer presentation state" — font scaling/keyboard-nav/popup logic)* next (highest brain-yield); then C9 (16, game-loop/AffineTEA/VeriSim types — mixed) and C10 (21, utils/tools/companions/narrative/proven — mixed); C12 (43, render-glue screens/PixiJS bindings — senses-heavy, migrated last). Established scalar/enum/predicate recipe. Genuine compiler gates remain: string wall (52 non-test .res — note the `[len:i32][utf8]` layout is already in `codegen.ml:375`, only the *ops* are missing), effect wall (110); unary-`~` codegen bug is a candidate Phase-F fix.
198+
| C5 | DONE | Engine coprocessors (2026-06-05, Opus). *2 integer brains extracted + 9 senses classified.* `Maths` (clamp/lerp-milli/dist_sq — float-wall convention, sqrt host-side) and — the strategic one — `Random`, the deterministic **xmur3 + mulberry32 PRNG**, the multiplayer-reproducibility backbone (host iterates the seed string + does the final u32→[0,1) float div; brain owns the i32 mixing). *Four gates green:* 2/2 compile, *2108/2108 parity* (Random **bit-exact** vs the JS source over the full i32 domain + UTF-16 code units, incl. the `>>>` emulation + signed-i32 multiplier constants), G3 n/a (transforms/mixing), 2/2 assail-clean. Senses (classified, not migrated): 5 `*Coprocessor` FFI bridges, Resize/GetResolution (float+DOM), Audio (Pixi), Navigation (screen-stack orchestration + async asset load, effect-gated), WaitFor (timing). Evidence: `migrated/EVIDENCE-C5.adoc`. NEXT: C11 (done below).
199+
| C11 | DONE | UI and accessibility coprocessors (2026-06-05) — *classified, NO_NEW_BRAINS.* All 10 files are host-side senses. `DualAlert.res` integer core (alert-level ordinals, escalation, trigger-milli, scrub, overall-threat, dispatch predicates) was already extracted in C6 (`DualAlert.affine`, 613/613 parity, LOSSLESS boundary proof). `DualAlertCoprocessor.res` is the existing ReScript FFI bridge to that wasm. `ForceLayoutCoprocessor.res` wraps `forcelayout.wasm`, a float-only physics kernel (euclidean/repulsion/attraction/velocity/alpha — f64 throughout; float-wall: brain stays host-side). Remaining 7 files (`Button`, `HubButton`, `NavButton`, `Label`, `VolumeSlider`, `InventoryUI`, `HardwareWiring`) are pure PixiJS/PixiUI senses with zero separable integer computation. No 4-gate run. Evidence: `migrated/EVIDENCE-C11.adoc`. NEXT: C9.
200+
| C9..C12 | TODO | Remaining clusters per `migration-map.json`: *C9 (16, game-loop/AffineTEA/VeriSim types — mixed)* next; then C10 (21, utils/tools/companions/narrative/proven — mixed); C12 (43, render-glue screens/PixiJS bindings — senses-heavy, migrated last). Established scalar/enum/predicate recipe. Genuine compiler gates remain: string wall (52 non-test .res — note the `[len:i32][utf8]` layout is already in `codegen.ml:375`, only the *ops* are missing), effect wall (110); unary-`~` codegen bug is a candidate Phase-F fix.
200201
| F+ | TODO | Compiler walls (string backend, then effects).
201202
| Ω | TODO (access-gated) | Cutover + ReScript extinction.
202203
|===
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// SPDX-License-Identifier: AGPL-3.0-or-later
2+
// SPDX-FileCopyrightText: 2025-2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
3+
= Cluster C11 (UI and accessibility coprocessors) — migration evidence (2026-06-05)
4+
:toc: macro
5+
6+
[IMPORTANT]
7+
====
8+
*Verdict: NO_NEW_BRAINS — wiring/senses cluster.* All 10 files are host-side
9+
senses (PixiJS UI components, coprocessor bridges, float-physics wiring). No
10+
new AffineScript kernels are required because:
11+
12+
1. The integer brain of `DualAlert.res` (alert-level ordinals, escalation,
13+
trigger-milli, scrub, overall-threat, dispatch predicates) was already
14+
extracted in *cluster C6* (`DualAlert.affine`, 613/613 parity, LOSSLESS
15+
boundary proof). `DualAlertCoprocessor.res` is the existing ReScript
16+
bridge to that wasm.
17+
2. `ForceLayoutCoprocessor.res` is a bridge to `forcelayout.wasm` (a
18+
float-only physics kernel — euclidean distance, repulsion/attraction
19+
velocity deltas, velocity decay, position integration, alpha cooling).
20+
The brain is f64-only; the float-wall convention defers it to host-side.
21+
3. `Button`, `HubButton`, `NavButton`, `Label`, `VolumeSlider`,
22+
`InventoryUI`, `HardwareWiring` are pure PixiJS/PixiUI components with
23+
zero separable integer computation.
24+
25+
No 4-gate recipe is applied; no new wasm is produced.
26+
====
27+
28+
toc::[]
29+
30+
== File-by-file disposition
31+
32+
[cols="3,1,4",options="header"]
33+
|===
34+
| File | Disposition | Reason
35+
| `src/app/ui/DualAlert.res` | SENSES (brain in C6) | Integer core (`levelValue`, `levelColor`, `escalateLevel`, `scrubStep`, trigger-milli, cooldown-milli, `overallThreat`, `shouldDispatchAntiHacker`, `guardsCheckingTerminals`) already lives in `DualAlert.affine` (C6, 613/613 parity). Float progress/trigger-severity orchestration stays host-side.
36+
| `src/app/ui/DualAlertCoprocessor.res` | SENSES (bridge) | ReScript FFI wrapping `DualAlertCoprocessorBridge.js` → `dualalert.wasm`. Pure `external` declarations; no logic.
37+
| `src/app/popups/ForceLayoutCoprocessor.res` | SENSES (float-brain bridge) | Wraps `forcelayout.wasm` float kernel (euclidean, repelDv, attractDv, decayVelocity, integratePosition, decayAlpha). All f64 primitives; float-wall convention: brain deferred to host-side.
38+
| `src/app/ui/Button.res` | SENSES (PixiJS) | FancyButton nine-slice wrapper + FontScale + Audio SFX. Zero integer computation.
39+
| `src/app/ui/HardwareWiring.res` | SENSES (PixiJS) | Interactive patch-panel with float catenary sag (`computeSagLocal`), quadratic Bézier cable rendering, pointer-event wiring, string template port IDs. No separable integer brain.
40+
| `src/app/ui/HubButton.res` | SENSES (PixiJS) | Programmatic Graphics FancyButton variant. Zero integer computation.
41+
| `src/app/ui/InventoryUI.res` | SENSES (UI) | `formatQuickbar` maps inventory slots to HUD display records. No integer computation.
42+
| `src/app/ui/Label.res` | SENSES (PixiJS) | `Text.make` wrapper with centered anchor. Zero integer computation.
43+
| `src/app/ui/NavButton.res` | SENSES (PixiJS) | Sidebar navigation FancyButton with active-indicator Graphics. Zero integer computation.
44+
| `src/app/ui/VolumeSlider.res` | SENSES (PixiJS) | PixiUI Slider component factory. Zero integer computation.
45+
|===
46+
47+
== DualAlert — de-duplication verification
48+
49+
The C11 cluster description names `src/app/ui/DualAlert.res` as a source file.
50+
C6's kernel inventory entry is:
51+
52+
----
53+
DualAlert.affine | DualAlert.res — dual-threat alert level machine
54+
----
55+
56+
Cross-check of C6 evidence versus C11 `DualAlert.res` content:
57+
58+
* C6 `DualAlert.affine` exports: `level_value`, `level_color`, `escalate_level`,
59+
`scrub_step`, `trigger_escalates`, `trigger_progress`, `trigger_level`,
60+
`cooldown_progress`, `overall_threat`, `should_dispatch_anti_hacker`,
61+
`guards_checking_terminals`.
62+
* C11 `DualAlertCoprocessor.res` bridge methods: `levelValue`, `levelColour`,
63+
`escalateLevel`, `scrubStep`, `triggerEscalates`, `triggerProgress`,
64+
`triggerLevel`, `cooldownProgress`, `overallThreat`, `shouldDispatchAntiHacker`,
65+
`guardsCheckingTerminals` — exact semantic correspondence.
66+
* The float functions in `DualAlert.res` (`physicalSeverity`, `cyberSeverity`,
67+
`triggerPhysical`, `triggerCyber`, `updateCooldown`) operate on the mutable
68+
`alertState` record (float progress/cooldown fields) — these are host-side
69+
orchestration that feeds integer primitives to the wasm.
70+
71+
Verdict: *no new brain needed*; C6's `DualAlert.affine` covers the integer surface.
72+
C6 evidence: `proposals/idaptik/migrated/EVIDENCE-C6.adoc` (Gate 2: 613/613 parity,
73+
Gate 3: LOSSLESS boundary proof, Gate 4: clean).
74+
75+
== Host-side senses: ForceLayout physics
76+
77+
`ForceLayoutCoprocessor.res` bridges the following float-only exports of
78+
`forcelayout.wasm`:
79+
80+
* `euclidean(bridge, x1, y1, x2, y2): float` — Euclidean distance
81+
* `repelDv(bridge, dist, d, strength, radius): float` — repulsion velocity delta
82+
* `attractDv(bridge, dist, d, strength): float` — attraction velocity delta
83+
* `decayVelocity(bridge, v, decay): float` — velocity damping
84+
* `integratePosition(bridge, pos, v, alpha): float` — position integration step
85+
* `decayAlpha(bridge, alpha, alphaDecay): float` — simulation cooling
86+
87+
All parameters and return values are `float`. This is a pure f64 physics
88+
kernel; the float-wall convention requires the brain to remain host-side
89+
(the AffineScript wasm backend has no f64 sqrt or general float codegen).
90+
No integer decomposition is applicable — the physics simulation requires
91+
continuous-domain arithmetic throughout.
92+
93+
== Impact on remaining clusters
94+
95+
C11 being NO_NEW_BRAINS does not affect the C9/C10/C12 roadmap. The
96+
`DualAlertCoprocessor` wasm is already live; the UI components remain host-side
97+
ReScript throughout Phase Ω. The completion-drive directive proceeds to *C9*.

proposals/idaptik/migration-map.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,15 @@
370370
"id": "C11",
371371
"name": "UI and accessibility coprocessors",
372372
"description": "UI widget logic, font scaling, i18n, keyboard navigation, popup logic \u2014 pure integer presentation state.",
373-
"status": "TODO",
373+
"status": "DONE",
374+
"done": {
375+
"date": "2026-06-05",
376+
"phase": "G",
377+
"verdict": "NO_NEW_BRAINS \u2014 wiring/senses cluster",
378+
"note": "All 10 files are host-side senses. DualAlert integer brain already extracted in C6 (DualAlert.affine, 613/613 parity, LOSSLESS boundary proof). DualAlertCoprocessor.res = bridge to C6 wasm. ForceLayoutCoprocessor.res = bridge to float-only physics wasm (euclidean/repulsion/attraction/velocity/alpha kernel; float-wall: deferred host-side). Button/HubButton/NavButton/Label/VolumeSlider/InventoryUI/HardwareWiring = pure PixiJS/UI senses with zero integer computation.",
379+
"no_4gate": "nothing new to compile/parity/prove; DualAlert integer core C6-verified (613/613), float physics stays host-side",
380+
"evidence": "proposals/idaptik/migrated/EVIDENCE-C11.adoc"
381+
},
374382
"files": [
375383
"src/app/popups/ForceLayoutCoprocessor.res",
376384
"src/app/ui/Button.res",

0 commit comments

Comments
 (0)