migrate(C5): engine coprocessors — Maths + deterministic PRNG, 4-gate green#543
Merged
Conversation
… green C5 = engine coprocessor layer. 2 integer brains extracted, 9 senses classified. Random (the strategic one): the deterministic xmur3 + mulberry32 PRNG from src/engine/utils/Random.res -- the multiplayer-reproducibility backbone. Identical seed -> identical stream, bit-for-bit, on every client. Per the brain/senses split the host iterates the seed string (feeding UTF-16 code units to xmur3_step) and does the final u32->[0,1) float division; the brain owns only the i32 mixing (xmur3_init/step/finalise, mulberry32_advance/ output/draw_raw -- matching the RandomCoprocessor.res bridge surface). Two compiler facts written around: * == i32.mul == Math.imul; >>> emulated via VmBitwise's lsr; the u32 multiplier constants as their signed-i32 bit patterns (identical under i32.mul). Parity is BIT-EXACT vs the original .res (oracle re-derives with JS-native Math.imul + >>>) over the full i32 domain + real UTF-16 code units. Maths: clamp (integer, swap-if-inverted), lerp_milli (milli-unit blend), dist_sq (squared distance -- sqrt stays host-side per the float wall). Four gates green: 2/2 compile, 2108/2108 parity (Maths 1982 + Random 126 bit-exact), G3 n/a (transforms/mixing), 2/2 assail-clean. Senses (classified, not migrated): 5 *Coprocessor FFI bridges, Resize + GetResolution (float + DOM reads), Audio (Pixi sound), Navigation (screen-stack orchestration + async asset load, effect-gated), WaitFor (timing). Ledger + map updated: C5 DONE. NEXT: C11. https://claude.ai/code/session_01WoKhFQePiRsAj7aqnxbG8s
f898532 to
443da73
Compare
🔍 Hypatia Security ScanFindings: 87 issues detected
View findings[
{
"reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action ons/checkout@v6\n needs attention",
"type": "unpinned_action",
"file": "publish-jsr.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action land/setup-deno@v2\n needs attention",
"type": "unpinned_action",
"file": "publish-jsr.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in affine-vscode-publish.yml",
"type": "missing_timeout_minutes",
"file": "affine-vscode-publish.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in ci.yml",
"type": "missing_timeout_minutes",
"file": "ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in ci.yml",
"type": "missing_timeout_minutes",
"file": "ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in ci.yml",
"type": "missing_timeout_minutes",
"file": "ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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.
C5 — engine coprocessors: Maths + the deterministic PRNG
C5 is the engine-coprocessor layer. 2 integer brains extracted, 9 senses classified.
Random— the strategic one (bit-exact PRNG)The deterministic xmur3 + mulberry32 PRNG from
src/engine/utils/Random.res— the multiplayer-reproducibility backbone. Identical seed → identical stream, bit-for-bit, on every client. Per the brain/senses split, the host iterates the seed string (feeding UTF-16 code units toxmur3_step) and does the finalu32 → [0,1)float division; the brain owns only the i32 mixing (6 exports matching theRandomCoprocessor.resbridge surface).Written around two compiler facts:
*==i32.mul==Math.imul;>>>emulated via VmBitwise'slsr; the u32 multiplier constants as their signed-i32 bit patterns (identical underi32.mul). Parity is bit-exact vs the original.res— the oracle re-derives the source with JS-nativeMath.imul+>>>over the full i32 domain + real UTF-16 code units.Mathsclamp(integer, swap-if-inverted),lerp_milli(milli-unit blend),dist_sq(squared distance;sqrtstays host-side per the float wall).Four gates green
Senses (classified, not migrated)
5
*CoprocessorFFI bridges ·Resize/GetResolution(float + DOM reads) ·Audio(Pixi) ·Navigation(screen-stack orchestration + async asset load, effect-gated) ·WaitFor(timing).C5 DONE. NEXT: C11 ("pure integer presentation state"). Staged-only under
proposals/idaptik/migrated/— idaptik write-gate honoured.https://claude.ai/code/session_01WoKhFQePiRsAj7aqnxbG8s
Generated by Claude Code