Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# NOW -- Published: Implement part 2 of 2 of the empty bodies in specs/vm/jit_semantics.t27 (4 functions) (2026-09-21)

## A bee's work on #4370, published from `queen-4370` (Closes #4370)

- The branch changes 1 file(s): `specs/vm/jit_semantics.t27`.
- `git diff --stat origin/master...queen-4370` reads: 1 file changed, 26 insertions(+), 6 deletions(-)
- This entry is written by the publisher, not by the bee. A pull request must
add exactly one `docs/now/` entry and a bee has no way to know that: its brief
names a boundary file and acceptance criteria, and `docs/now/` is neither.
- What this entry does NOT establish: that the work is correct. The gates on the
pull request judge that, and they are the same gates every other change meets.
32 changes: 26 additions & 6 deletions specs/vm/jit_semantics.t27
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module JitSemantics {
// Caches compiled functions by dimension to avoid redundant compilation
// Maintains compiler instance for on-demand compilation
pub struct JitCache {
bind_cache : map<usize, JitVsaFn>, // Cached bind functions by dimension
bind_cache : map<usize, map<VsaOperation, JitVsaFn>>, // Cached functions by dimension and operation
compiler : JitCompiler, // Compiler instance for compilation
allocator_id : u16, // Allocator identifier
}
Expand Down Expand Up @@ -165,11 +165,31 @@ module JitSemantics {
// Returns function pointer or compiles new function if needed
// Complexity: O(1) for cache hit, O(dimension) for compile
pub fn getOrCompile(cache: &JitCache, op: VsaOperation, dimension: usize) -> ?JitVsaFn {
// TODO: Implement actual cache lookup and compilation
_ = cache;
_ = op;
_ = dimension;
null
// Look in the cache for the given dimension and operation
// (t27 has no `if let`: test the optional, then unwrap it.)
let inner_map_opt = cache.bind_cache.get(dimension);
if (inner_map_opt == null) {
let new_inner_map = HashMap::new();
cache.bind_cache.insert(dimension, new_inner_map);
}
let inner_map = cache.bind_cache.get(dimension).unwrap();
let cached = inner_map.get(op);
if (cached != null) {
return cached;
}
// Not found in cache, need to compile
// Reset the compiler to clear any previous state
resetCompiler(&cache.compiler);
// Compile the operation for the given dimension
_ = compileOperation(&cache.compiler, op, dimension);
// Finalize to get the function pointer
let func = finalizeCompiler(&cache.compiler);
if (func == null) {
return null;
}
// Store the function in the cache
inner_map.insert(op, func.unwrap());
return func;
}

// ========================================================================
Expand Down
Loading