Commit 562a31c
committed
CORRECTION to D1.1: ndarray::hpc::jitson_cranelift already ships JitEngine
User asked "I presume you are aware of cranelift/jitson" — honest
answer: Cranelift generally yes (Bytecode Alliance, wasmtime),
ndarray-side jitson engine specifically NO. Probed it just now.
ndarray already ships the full JIT pipeline:
src/hpc/jitson/ — JITSON template format (JSON-based):
parser / validator / template / precompile / scan_config /
packed / noise
src/hpc/jitson_cranelift/ — Cranelift engine:
engine.rs (JitEngine + JitEngineBuilder)
ir.rs / scan_jit.rs / noise_jit.rs / detect.rs
Deps behind `jit-native` feature:
cranelift-codegen 0.116, cranelift-jit, cranelift-module,
cranelift-frontend, target-lexicon
Upstream two-phase lifecycle is stronger than my D1.1 scaffold:
BUILD: &mut JitEngine, compile(ScanParams) -> Result<u64>
RUN: Arc<JitEngine> freezes by Rust ownership
&mut self unreachable through Arc
get() ~5 ns (plain HashMap::get, no synchronization)
vs my scaffold's ~25 ns RwLock read
The freeze is enforced by the TYPE SYSTEM, not a runtime lock.
The D1.1 scaffold is not redundant — CodecParams (codec-sweep key)
differs from ScanParams (thinking-style-scan key). Generic-over-H
design anticipates D1.1b: the scaffold wraps ndarray's JitEngine
at the H slot when the real engine lands. But my RwLock lifecycle
is worse than the Arc-freeze upstream uses.
Revised D1.1b plan (STATUS_BOARD updated):
CodecKernelEngine mirroring ndarray's BUILD/RUN pattern:
pub struct CodecKernelEngine {
inner: ndarray::hpc::jitson_cranelift::JitEngine,
codec_sig_to_inner_id: HashMap<u64, u64>,
}
.build() -> Builder
.compile(&mut self, &CodecParams) -> Result<u64>
.freeze(self) -> Arc<Self> // moves to RUN phase
.get(&self, &CodecParams) -> Option<KernelHandle>
Target ~250 LOC; JitEngine itself is DONE upstream. What's left
is the CodecParams adapter + codec-specific JITSON template
(CodecScanParams struct OR direct JSON emission from CodecParams).
D1.1 scaffold stays as StubKernel-backed test fixture. The
generic-over-H design is the wedge that lets both coexist.
EPIPHANIES.md PREPEND: "CORRECTION to D1.1 scaffold".
STATUS_BOARD.md: D1.1b description updated to cite the real upstream
surface + revised ~250 LOC target + path to jitson_cranelift/engine.rs.
Honesty landed explicitly so next session doesn't repeat the
"guess at upstream surface" failure mode.
https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh1 parent 58d7b2c commit 562a31c
2 files changed
Lines changed: 79 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
68 | 146 | | |
69 | 147 | | |
70 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
0 commit comments