✓
Passing This code compiles and runs correctly.
Code
// PINS: a WIDE all-f64 container — one entity row carrying four flattened ECS
// components (Transform mat4x4 as 16 columns, Position/Rotation/Velocity vec3
// as 9) — declared, inserted twice, swept back, with the declaration and the
// insert literal both spanning MULTIPLE LINES.
//
// This is ecs_bench_suite's simple_insert row (rust-gamedev's workload, not
// ours) in the only spelling the column system has: pure SoA scalars, one
// column per lane. Compound column TYPES (a vec3/mat4x4-valued column) remain
// uninvented surface — 690_020 carries that residue. Until they exist, this is
// the spelling a game consumer writes, and the corpus's widest store before it
// was seven columns (690_111); a 25-column store, and a `new`/`insert` block
// broken across lines, had never been asked for.
import std/io
import std/store
std/store:new(ents, capacity: 4) {
t00: f64, t01: f64, t02: f64, t03: f64,
t10: f64, t11: f64, t12: f64, t13: f64,
t20: f64, t21: f64, t22: f64, t23: f64,
t30: f64, t31: f64, t32: f64, t33: f64,
px: f64, py: f64, pz: f64,
rx: f64, ry: f64, rz: f64,
vx: f64, vy: f64, vz: f64
}
std/store:insert(ents) {
t00: 1.0, t01: 0.0, t02: 0.0, t03: 0.0,
t10: 0.0, t11: 1.0, t12: 0.0, t13: 0.0,
t20: 0.0, t21: 0.0, t22: 1.0, t23: 0.0,
t30: 0.0, t31: 0.0, t32: 0.0, t33: 1.0,
px: 1.0, py: 2.0, pz: 3.0,
rx: 0.0, ry: 0.0, rz: 0.0,
vx: 0.5, vy: 0.25, vz: 0.125
}
std/store:insert(ents) {
t00: 2.0, t01: 0.0, t02: 0.0, t03: 0.0,
t10: 0.0, t11: 2.0, t12: 0.0, t13: 0.0,
t20: 0.0, t21: 0.0, t22: 2.0, t23: 0.0,
t30: 0.0, t31: 0.0, t32: 0.0, t33: 4.0,
px: 10.0, py: 20.0, pz: 30.0,
rx: 0.0, ry: 0.0, rz: 1.5,
vx: 5.0, vy: 2.5, vz: 1.25
}
std/store:query(ents)
! query e |> std/io:print.ln("t00 {{ e.t00:f }} t33 {{ e.t33:f }} px {{ e.px:f }} rz {{ e.rz:f }} vz {{ e.vz:f }}")
Actual
t00 1 t33 1 px 1 rz 0 vz 0.125
t00 2 t33 4 px 10 rz 1.5 vz 1.25
Expected output
✓ Zig✓ C#t00 1 t33 1 px 1 rz 0 vz 0.125
t00 2 t33 4 px 10 rz 1.5 vz 1.25
Emitted Zig source
// Access compiler flags via the per-user compiler_env module
const CompilerEnv = @import("compiler_env").CompilerEnv;
pub const panic = if (@import("builtin").mode == .Debug)
@import("std").debug.FullPanic(@import("std").debug.defaultPanic)
else
@import("std").debug.simple_panic;
const __koru_bare = struct {
extern fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int;
extern fn free(ptr: ?*anyopaque) void;
fn bareAlloc(_: *anyopaque, len: usize, alignment: @import("std").mem.Alignment, _: usize) ?[*]u8 {
var p: ?*anyopaque = null;
const a = @max(alignment.toByteUnits(), @sizeOf(usize));
if (posix_memalign(&p, a, len) != 0) return null;
return @ptrCast(p);
}
fn bareResize(_: *anyopaque, _: []u8, _: @import("std").mem.Alignment, _: usize, _: usize) bool { return false; }
fn bareRemap(_: *anyopaque, _: []u8, _: @import("std").mem.Alignment, _: usize, _: usize) ?[*]u8 { return null; }
fn bareFree(_: *anyopaque, memory: []u8, _: @import("std").mem.Alignment, _: usize) void { free(@ptrCast(memory.ptr)); }
const vtable = @import("std").mem.Allocator.VTable{ .alloc = bareAlloc, .resize = bareResize, .remap = bareRemap, .free = bareFree };
const allocator = @import("std").mem.Allocator{ .ptr = undefined, .vtable = &vtable };
};
const __koru_backing = if (@import("builtin").link_libc) @import("std").heap.c_allocator else if (@import("builtin").os.tag == .freestanding) __koru_bare.allocator else @import("std").heap.page_allocator;
var __koru_leak_count: usize = 0;
fn __koru_alloc(ctx: *anyopaque, len: usize, alignment: @import("std").mem.Alignment, ret_addr: usize) ?[*]u8 {
_ = ctx;
const r = __koru_backing.rawAlloc(len, alignment, ret_addr);
if (comptime @import("builtin").mode == .Debug) {
if (r != null) __koru_leak_count += 1;
}
return r;
}
fn __koru_resize(ctx: *anyopaque, memory: []u8, alignment: @import("std").mem.Alignment, new_len: usize, ret_addr: usize) bool {
_ = ctx;
return __koru_backing.rawResize(memory, alignment, new_len, ret_addr);
}
fn __koru_remap(ctx: *anyopaque, memory: []u8, alignment: @import("std").mem.Alignment, new_len: usize, ret_addr: usize) ?[*]u8 {
_ = ctx;
return __koru_backing.rawRemap(memory, alignment, new_len, ret_addr);
}
fn __koru_free(ctx: *anyopaque, memory: []u8, alignment: @import("std").mem.Alignment, ret_addr: usize) void {
_ = ctx;
__koru_backing.rawFree(memory, alignment, ret_addr);
if (comptime @import("builtin").mode == .Debug) {
__koru_leak_count -= 1;
}
}
const __koru_vtable = @import("std").mem.Allocator.VTable{ .alloc = __koru_alloc, .resize = __koru_resize, .remap = __koru_remap, .free = __koru_free };
pub fn koru_allocator() @import("std").mem.Allocator {
return .{ .ptr = undefined, .vtable = &__koru_vtable };
}
pub inline fn __koru_intcast(comptime T: type, x: anytype) T {
if (comptime (@import("builtin").mode == .Debug or @import("builtin").mode == .ReleaseSafe))
return @as(T, @intCast(x));
const dst = @typeInfo(T);
const src = @typeInfo(@TypeOf(x));
if (comptime (dst == .int and src == .int and dst.int.bits == src.int.bits and dst.int.signedness != src.int.signedness))
return @as(T, @bitCast(x));
return @as(T, @intCast(x));
}
pub fn koru_leak_check() void {
if (comptime @import("builtin").mode != .Debug) return;
if (__koru_leak_count == 0) return;
if (comptime @import("builtin").target.os.tag == .freestanding) {
if (comptime @import("builtin").cpu.arch == .wasm32 or @import("builtin").cpu.arch == .wasm64) {
@panic("KORU LEAK CHECK FAILED: the produced program leaked");
} else {
const __klc = struct { extern var stdout: ?*anyopaque; extern fn fputs(__s: [*:0]const u8, __st: ?*anyopaque) c_int; };
var __lb: [128]u8 = undefined;
const __lm = "KORU LEAK CHECK FAILED: allocations still outstanding at end of run: ";
@memcpy(__lb[0..__lm.len], __lm);
var __ln: usize = __lm.len;
var __lv = __koru_leak_count;
var __ld: [20]u8 = undefined;
var __lk: usize = 0;
while (__lv > 0) : (__lk += 1) { __ld[__lk] = @intCast('0' + __lv % 10); __lv /= 10; }
for (0..__lk) |__li| { __lb[__ln] = __ld[__lk - 1 - __li]; __ln += 1; }
__lb[__ln] = '\n'; __ln += 1; __lb[__ln] = 0;
_ = __klc.fputs(@as([*:0]const u8, @ptrCast(&__lb)), __klc.stdout);
@trap();
}
} else {
@import("std").debug.print("KORU LEAK CHECK FAILED: the produced program leaked (trace above)\n", .{});
@import("std").process.exit(1);
}
}
pub const main_module = struct {
// std/store: plural store 'ents' created (SoA cell + insert/query/write/take/stripe units); fields t00: f64, t01: f64, t02: f64, t03: f64, t10: f64, t11: f64, t12: f64, t13: f64, t20: f64, t21: f64, t22: f64, t23: f64, t30: f64, t31: f64, t32: f64, t33: f64, px: f64, py: f64, pz: f64, rx: f64, ry: f64, rz: f64, vx: f64, vy: f64, vz: f64
// >>> FLOW: tests/regression/600_STDLIB/690_STORE/690_119_flattened_mat4_vec3_row/input.k:27 ~input:__store_insert_ents()
pub fn flow0() void {
_ = main_module.__store_insert_ents_event.handler(.{ .t00 = 1.0, .t01 = 0.0, .t02 = 0.0, .t03 = 0.0, .t10 = 0.0, .t11 = 1.0, .t12 = 0.0, .t13 = 0.0, .t20 = 0.0, .t21 = 0.0, .t22 = 1.0, .t23 = 0.0, .t30 = 0.0, .t31 = 0.0, .t32 = 0.0, .t33 = 1.0, .px = 1.0, .py = 2.0, .pz = 3.0, .rx = 0.0, .ry = 0.0, .rz = 0.0, .vx = 0.5, .vy = 0.25, .vz = 0.125, .__site_line = 27 });
}
// >>> FLOW: tests/regression/600_STDLIB/690_STORE/690_119_flattened_mat4_vec3_row/input.k:37 ~input:__store_insert_ents()
pub fn flow1() void {
_ = main_module.__store_insert_ents_event.handler(.{ .t00 = 2.0, .t01 = 0.0, .t02 = 0.0, .t03 = 0.0, .t10 = 0.0, .t11 = 2.0, .t12 = 0.0, .t13 = 0.0, .t20 = 0.0, .t21 = 0.0, .t22 = 2.0, .t23 = 0.0, .t30 = 0.0, .t31 = 0.0, .t32 = 0.0, .t33 = 4.0, .px = 10.0, .py = 20.0, .pz = 30.0, .rx = 0.0, .ry = 0.0, .rz = 1.5, .vx = 5.0, .vy = 2.5, .vz = 1.25, .__site_line = 37 });
}
// >>> FLOW: tests/regression/600_STDLIB/690_STORE/690_119_flattened_mat4_vec3_row/input.k:47 ~input:__store_sweeprun_ents_L48_690_119_flattened_mat4_vec3_row_input_bd70bf()
pub fn flow2() void {
_ = main_module.__store_sweeprun_ents_L48_690_119_flattened_mat4_vec3_row_input_bd70bf_event.handler(.{ });
}
pub fn koru_start_flow() void {
const result_0 = koru_koru.start_event.handler(.{ });
const result_0_done = result_0.done;
_ = &result_0_done;
}
pub fn koru_end_flow() void {
const result_0 = koru_koru.end_event.handler(.{ });
const result_0_done = result_0.done;
_ = &result_0_done;
}
const __KoruStoreT_ents = struct {
t00: [4]f64 = undefined,
t01: [4]f64 = undefined,
t02: [4]f64 = undefined,
t03: [4]f64 = undefined,
t10: [4]f64 = undefined,
t11: [4]f64 = undefined,
t12: [4]f64 = undefined,
t13: [4]f64 = undefined,
t20: [4]f64 = undefined,
t21: [4]f64 = undefined,
t22: [4]f64 = undefined,
t23: [4]f64 = undefined,
t30: [4]f64 = undefined,
t31: [4]f64 = undefined,
t32: [4]f64 = undefined,
t33: [4]f64 = undefined,
px: [4]f64 = undefined,
py: [4]f64 = undefined,
pz: [4]f64 = undefined,
rx: [4]f64 = undefined,
ry: [4]f64 = undefined,
rz: [4]f64 = undefined,
vx: [4]f64 = undefined,
vy: [4]f64 = undefined,
vz: [4]f64 = undefined,
len: usize = 0,
};
var __koru_store_ents: __KoruStoreT_ents = .{};
const __KoruStoreRow_ents = struct { t00: f64, t01: f64, t02: f64, t03: f64, t10: f64, t11: f64, t12: f64, t13: f64, t20: f64, t21: f64, t22: f64, t23: f64, t30: f64, t31: f64, t32: f64, t33: f64, px: f64, py: f64, pz: f64, rx: f64, ry: f64, rz: f64, vx: f64, vy: f64, vz: f64 };
pub const __store_insert_ents_event = struct {
pub const Input = struct {
t00: f64,
t01: f64,
t02: f64,
t03: f64,
t10: f64,
t11: f64,
t12: f64,
t13: f64,
t20: f64,
t21: f64,
t22: f64,
t23: f64,
t30: f64,
t31: f64,
t32: f64,
t33: f64,
px: f64,
py: f64,
pz: f64,
rx: f64,
ry: f64,
rz: f64,
vx: f64,
vy: f64,
vz: f64,
__site_line: i64,
};
pub const Output = void;
pub inline fn handler(__koru_event_input: @This().Input) @This().Output {
return __koru_handler_impl(__koru_event_input.t00, __koru_event_input.t01, __koru_event_input.t02, __koru_event_input.t03, __koru_event_input.t10, __koru_event_input.t11, __koru_event_input.t12, __koru_event_input.t13, __koru_event_input.t20, __koru_event_input.t21, __koru_event_input.t22, __koru_event_input.t23, __koru_event_input.t30, __koru_event_input.t31, __koru_event_input.t32, __koru_event_input.t33, __koru_event_input.px, __koru_event_input.py, __koru_event_input.pz, __koru_event_input.rx, __koru_event_input.ry, __koru_event_input.rz, __koru_event_input.vx, __koru_event_input.vy, __koru_event_input.vz, __koru_event_input.__site_line);
}
fn __koru_handler_impl(__koru_p_0: f64, __koru_p_1: f64, __koru_p_2: f64, __koru_p_3: f64, __koru_p_4: f64, __koru_p_5: f64, __koru_p_6: f64, __koru_p_7: f64, __koru_p_8: f64, __koru_p_9: f64, __koru_p_10: f64, __koru_p_11: f64, __koru_p_12: f64, __koru_p_13: f64, __koru_p_14: f64, __koru_p_15: f64, __koru_p_16: f64, __koru_p_17: f64, __koru_p_18: f64, __koru_p_19: f64, __koru_p_20: f64, __koru_p_21: f64, __koru_p_22: f64, __koru_p_23: f64, __koru_p_24: f64, __koru_p_25: i64) @This().Output {
const __koru_event_input: @This().Input = .{ .t00 = __koru_p_0, .t01 = __koru_p_1, .t02 = __koru_p_2, .t03 = __koru_p_3, .t10 = __koru_p_4, .t11 = __koru_p_5, .t12 = __koru_p_6, .t13 = __koru_p_7, .t20 = __koru_p_8, .t21 = __koru_p_9, .t22 = __koru_p_10, .t23 = __koru_p_11, .t30 = __koru_p_12, .t31 = __koru_p_13, .t32 = __koru_p_14, .t33 = __koru_p_15, .px = __koru_p_16, .py = __koru_p_17, .pz = __koru_p_18, .rx = __koru_p_19, .ry = __koru_p_20, .rz = __koru_p_21, .vx = __koru_p_22, .vy = __koru_p_23, .vz = __koru_p_24, .__site_line = __koru_p_25 };
// >>> PROC: __store_insert_ents [tests/regression/600_STDLIB/690_STORE/690_119_flattened_mat4_vec3_row/input.k:17]
const t00 = __koru_event_input.t00;
const t01 = __koru_event_input.t01;
const t02 = __koru_event_input.t02;
const t03 = __koru_event_input.t03;
const t10 = __koru_event_input.t10;
const t11 = __koru_event_input.t11;
const t12 = __koru_event_input.t12;
const t13 = __koru_event_input.t13;
const t20 = __koru_event_input.t20;
const t21 = __koru_event_input.t21;
const t22 = __koru_event_input.t22;
const t23 = __koru_event_input.t23;
const t30 = __koru_event_input.t30;
const t31 = __koru_event_input.t31;
const t32 = __koru_event_input.t32;
const t33 = __koru_event_input.t33;
const px = __koru_event_input.px;
const py = __koru_event_input.py;
const pz = __koru_event_input.pz;
const rx = __koru_event_input.rx;
const ry = __koru_event_input.ry;
const rz = __koru_event_input.rz;
const vx = __koru_event_input.vx;
const vy = __koru_event_input.vy;
const vz = __koru_event_input.vz;
const __site_line = __koru_event_input.__site_line;
_ = &t00;
_ = &t01;
_ = &t02;
_ = &t03;
_ = &t10;
_ = &t11;
_ = &t12;
_ = &t13;
_ = &t20;
_ = &t21;
_ = &t22;
_ = &t23;
_ = &t30;
_ = &t31;
_ = &t32;
_ = &t33;
_ = &px;
_ = &py;
_ = &pz;
_ = ℞
_ = &ry;
_ = &rz;
_ = &vx;
_ = &vy;
_ = &vz;
_ = &__site_line;
_ = &__koru_event_input;
if (__koru_store_ents.len >= 4) @panic("std/store: store 'ents' is full (capacity 4) - declared capacity and the `| full` branch are pinned at 690_011");
const __koru_new_row = __koru_store_ents.len;
__koru_store_ents.t00[__koru_new_row] = t00;
__koru_store_ents.t01[__koru_new_row] = t01;
__koru_store_ents.t02[__koru_new_row] = t02;
__koru_store_ents.t03[__koru_new_row] = t03;
__koru_store_ents.t10[__koru_new_row] = t10;
__koru_store_ents.t11[__koru_new_row] = t11;
__koru_store_ents.t12[__koru_new_row] = t12;
__koru_store_ents.t13[__koru_new_row] = t13;
__koru_store_ents.t20[__koru_new_row] = t20;
__koru_store_ents.t21[__koru_new_row] = t21;
__koru_store_ents.t22[__koru_new_row] = t22;
__koru_store_ents.t23[__koru_new_row] = t23;
__koru_store_ents.t30[__koru_new_row] = t30;
__koru_store_ents.t31[__koru_new_row] = t31;
__koru_store_ents.t32[__koru_new_row] = t32;
__koru_store_ents.t33[__koru_new_row] = t33;
__koru_store_ents.px[__koru_new_row] = px;
__koru_store_ents.py[__koru_new_row] = py;
__koru_store_ents.pz[__koru_new_row] = pz;
__koru_store_ents.rx[__koru_new_row] = rx;
__koru_store_ents.ry[__koru_new_row] = ry;
__koru_store_ents.rz[__koru_new_row] = rz;
__koru_store_ents.vx[__koru_new_row] = vx;
__koru_store_ents.vy[__koru_new_row] = vy;
__koru_store_ents.vz[__koru_new_row] = vz;
__koru_store_ents.len += 1;
return;
}
};
pub const __store_apply_ents_event = struct {
pub const Input = struct {
row: usize,
field: i64,
value_0: f64,
value_1: f64,
value_2: f64,
value_3: f64,
value_4: f64,
value_5: f64,
value_6: f64,
value_7: f64,
value_8: f64,
value_9: f64,
value_10: f64,
value_11: f64,
value_12: f64,
value_13: f64,
value_14: f64,
value_15: f64,
value_16: f64,
value_17: f64,
value_18: f64,
value_19: f64,
value_20: f64,
value_21: f64,
value_22: f64,
value_23: f64,
value_24: f64,
};
pub const Output = union(enum(u8)) {
t00: f64,
t01: f64,
t02: f64,
t03: f64,
t10: f64,
t11: f64,
t12: f64,
t13: f64,
t20: f64,
t21: f64,
t22: f64,
t23: f64,
t30: f64,
t31: f64,
t32: f64,
t33: f64,
px: f64,
py: f64,
pz: f64,
rx: f64,
ry: f64,
rz: f64,
vx: f64,
vy: f64,
vz: f64,
};
pub inline fn handler(__koru_event_input: @This().Input) @This().Output {
return __koru_handler_impl(__koru_event_input.row, __koru_event_input.field, __koru_event_input.value_0, __koru_event_input.value_1, __koru_event_input.value_2, __koru_event_input.value_3, __koru_event_input.value_4, __koru_event_input.value_5, __koru_event_input.value_6, __koru_event_input.value_7, __koru_event_input.value_8, __koru_event_input.value_9, __koru_event_input.value_10, __koru_event_input.value_11, __koru_event_input.value_12, __koru_event_input.value_13, __koru_event_input.value_14, __koru_event_input.value_15, __koru_event_input.value_16, __koru_event_input.value_17, __koru_event_input.value_18, __koru_event_input.value_19, __koru_event_input.value_20, __koru_event_input.value_21, __koru_event_input.value_22, __koru_event_input.value_23, __koru_event_input.value_24);
}
fn __koru_handler_impl(__koru_p_0: usize, __koru_p_1: i64, __koru_p_2: f64, __koru_p_3: f64, __koru_p_4: f64, __koru_p_5: f64, __koru_p_6: f64, __koru_p_7: f64, __koru_p_8: f64, __koru_p_9: f64, __koru_p_10: f64, __koru_p_11: f64, __koru_p_12: f64, __koru_p_13: f64, __koru_p_14: f64, __koru_p_15: f64, __koru_p_16: f64, __koru_p_17: f64, __koru_p_18: f64, __koru_p_19: f64, __koru_p_20: f64, __koru_p_21: f64, __koru_p_22: f64, __koru_p_23: f64, __koru_p_24: f64, __koru_p_25: f64, __koru_p_26: f64) @This().Output {
const __koru_event_input: @This().Input = .{ .row = __koru_p_0, .field = __koru_p_1, .value_0 = __koru_p_2, .value_1 = __koru_p_3, .value_2 = __koru_p_4, .value_3 = __koru_p_5, .value_4 = __koru_p_6, .value_5 = __koru_p_7, .value_6 = __koru_p_8, .value_7 = __koru_p_9, .value_8 = __koru_p_10, .value_9 = __koru_p_11, .value_10 = __koru_p_12, .value_11 = __koru_p_13, .value_12 = __koru_p_14, .value_13 = __koru_p_15, .value_14 = __koru_p_16, .value_15 = __koru_p_17, .value_16 = __koru_p_18, .value_17 = __koru_p_19, .value_18 = __koru_p_20, .value_19 = __koru_p_21, .value_20 = __koru_p_22, .value_21 = __koru_p_23, .value_22 = __koru_p_24, .value_23 = __koru_p_25, .value_24 = __koru_p_26 };
// >>> PROC: __store_apply_ents [tests/regression/600_STDLIB/690_STORE/690_119_flattened_mat4_vec3_row/input.k:17]
const row = __koru_event_input.row;
const field = __koru_event_input.field;
const value_0 = __koru_event_input.value_0;
const value_1 = __koru_event_input.value_1;
const value_2 = __koru_event_input.value_2;
const value_3 = __koru_event_input.value_3;
const value_4 = __koru_event_input.value_4;
const value_5 = __koru_event_input.value_5;
const value_6 = __koru_event_input.value_6;
const value_7 = __koru_event_input.value_7;
const value_8 = __koru_event_input.value_8;
const value_9 = __koru_event_input.value_9;
const value_10 = __koru_event_input.value_10;
const value_11 = __koru_event_input.value_11;
const value_12 = __koru_event_input.value_12;
const value_13 = __koru_event_input.value_13;
const value_14 = __koru_event_input.value_14;
const value_15 = __koru_event_input.value_15;
const value_16 = __koru_event_input.value_16;
const value_17 = __koru_event_input.value_17;
const value_18 = __koru_event_input.value_18;
const value_19 = __koru_event_input.value_19;
const value_20 = __koru_event_input.value_20;
const value_21 = __koru_event_input.value_21;
const value_22 = __koru_event_input.value_22;
const value_23 = __koru_event_input.value_23;
const value_24 = __koru_event_input.value_24;
_ = &row;
_ = &field;
_ = &value_0;
_ = &value_1;
_ = &value_2;
_ = &value_3;
_ = &value_4;
_ = &value_5;
_ = &value_6;
_ = &value_7;
_ = &value_8;
_ = &value_9;
_ = &value_10;
_ = &value_11;
_ = &value_12;
_ = &value_13;
_ = &value_14;
_ = &value_15;
_ = &value_16;
_ = &value_17;
_ = &value_18;
_ = &value_19;
_ = &value_20;
... [truncated - 28KB total]Emitted C# source
static class main_module {
public static void __koru_stdout_write(dynamic s) => global::System.Console.Out.Write(s);
public static void __koru_stderr_write(dynamic s) => global::System.Console.Error.Write(s);
// The mutable handle carrier — `*String`-style resources are
// `new __KoruBox { data = … }` because C# anonymous types are
// read-only: `s.data = …` (std/string append/clear, handle
// mutation generally) needs a settable member.
public class __KoruBox { public dynamic data; }
// Textification for `{{ … }}` operands: C# bool ToStrings as
// `True` where Koru prints `true`, and the operand's static type
// is unknown at this boundary — a `(x) is bool` inline test would
// be a compile error on statically-typed operands instead. Generic
// on purpose: `dynamic` boxed every value-type operand — measured
// ~1s/10M elements on 012_threat_scanner — while T specializes to
// the operand's own ToString() with no box.
public static string __koru_str<T>(T v) => v is bool b ? (b ? "true" : "false") : v?.ToString();
// std/store: plural store 'ents' created (SoA cell + insert/query/write/take/stripe units); fields t00: f64, t01: f64, t02: f64, t03: f64, t10: f64, t11: f64, t12: f64, t13: f64, t20: f64, t21: f64, t22: f64, t23: f64, t30: f64, t31: f64, t32: f64, t33: f64, px: f64, py: f64, pz: f64, rx: f64, ry: f64, rz: f64, vx: f64, vy: f64, vz: f64
static class __koru_store_ents {
public static double[] t00 = new double[4];
public static double[] t01 = new double[4];
public static double[] t02 = new double[4];
public static double[] t03 = new double[4];
public static double[] t10 = new double[4];
public static double[] t11 = new double[4];
public static double[] t12 = new double[4];
public static double[] t13 = new double[4];
public static double[] t20 = new double[4];
public static double[] t21 = new double[4];
public static double[] t22 = new double[4];
public static double[] t23 = new double[4];
public static double[] t30 = new double[4];
public static double[] t31 = new double[4];
public static double[] t32 = new double[4];
public static double[] t33 = new double[4];
public static double[] px = new double[4];
public static double[] py = new double[4];
public static double[] pz = new double[4];
public static double[] rx = new double[4];
public static double[] ry = new double[4];
public static double[] rz = new double[4];
public static double[] vx = new double[4];
public static double[] vy = new double[4];
public static double[] vz = new double[4];
public static long len = 0;
public static long __koru_brand = -1;
}
public static class __store_insert_ents_event {
public struct Input {
public double t00;
public double t01;
public double t02;
public double t03;
public double t10;
public double t11;
public double t12;
public double t13;
public double t20;
public double t21;
public double t22;
public double t23;
public double t30;
public double t31;
public double t32;
public double t33;
public double px;
public double py;
public double pz;
public double rx;
public double ry;
public double rz;
public double vx;
public double vy;
public double vz;
public long __site_line;
}
public static dynamic handler(Input __koru_input) {
var t00 = __koru_input.t00;
var t01 = __koru_input.t01;
var t02 = __koru_input.t02;
var t03 = __koru_input.t03;
var t10 = __koru_input.t10;
var t11 = __koru_input.t11;
var t12 = __koru_input.t12;
var t13 = __koru_input.t13;
var t20 = __koru_input.t20;
var t21 = __koru_input.t21;
var t22 = __koru_input.t22;
var t23 = __koru_input.t23;
var t30 = __koru_input.t30;
var t31 = __koru_input.t31;
var t32 = __koru_input.t32;
var t33 = __koru_input.t33;
var px = __koru_input.px;
var py = __koru_input.py;
var pz = __koru_input.pz;
var rx = __koru_input.rx;
var ry = __koru_input.ry;
var rz = __koru_input.rz;
var vx = __koru_input.vx;
var vy = __koru_input.vy;
var vz = __koru_input.vz;
var __site_line = __koru_input.__site_line;
if (__koru_store_ents.len >= 4) throw new global::System.Exception("std/store: store 'ents' is full (capacity 4) - declared capacity and the `| full` branch are pinned at 690_011");
long __koru_new_row = __koru_store_ents.len;
__koru_store_ents.t00[__koru_new_row] = t00;
__koru_store_ents.t01[__koru_new_row] = t01;
__koru_store_ents.t02[__koru_new_row] = t02;
__koru_store_ents.t03[__koru_new_row] = t03;
__koru_store_ents.t10[__koru_new_row] = t10;
__koru_store_ents.t11[__koru_new_row] = t11;
__koru_store_ents.t12[__koru_new_row] = t12;
__koru_store_ents.t13[__koru_new_row] = t13;
__koru_store_ents.t20[__koru_new_row] = t20;
__koru_store_ents.t21[__koru_new_row] = t21;
__koru_store_ents.t22[__koru_new_row] = t22;
__koru_store_ents.t23[__koru_new_row] = t23;
__koru_store_ents.t30[__koru_new_row] = t30;
__koru_store_ents.t31[__koru_new_row] = t31;
__koru_store_ents.t32[__koru_new_row] = t32;
__koru_store_ents.t33[__koru_new_row] = t33;
__koru_store_ents.px[__koru_new_row] = px;
__koru_store_ents.py[__koru_new_row] = py;
__koru_store_ents.pz[__koru_new_row] = pz;
__koru_store_ents.rx[__koru_new_row] = rx;
__koru_store_ents.ry[__koru_new_row] = ry;
__koru_store_ents.rz[__koru_new_row] = rz;
__koru_store_ents.vx[__koru_new_row] = vx;
__koru_store_ents.vy[__koru_new_row] = vy;
__koru_store_ents.vz[__koru_new_row] = vz;
__koru_store_ents.len += 1;
return default;
}
}
public static class __store_apply_ents_event {
public struct Input {
public long row;
public long field;
public double value_0;
public double value_1;
public double value_2;
public double value_3;
public double value_4;
public double value_5;
public double value_6;
public double value_7;
public double value_8;
public double value_9;
public double value_10;
public double value_11;
public double value_12;
public double value_13;
public double value_14;
public double value_15;
public double value_16;
public double value_17;
public double value_18;
public double value_19;
public double value_20;
public double value_21;
public double value_22;
public double value_23;
public double value_24;
}
public struct Output {
public string tag;
public double t00;
public double t01;
public double t02;
public double t03;
public double t10;
public double t11;
public double t12;
public double t13;
public double t20;
public double t21;
public double t22;
public double t23;
public double t30;
public double t31;
public double t32;
public double t33;
public double px;
public double py;
public double pz;
public double rx;
public double ry;
public double rz;
public double vx;
public double vy;
public double vz;
}
public static Output handler(Input __koru_input) {
var row = __koru_input.row;
var field = __koru_input.field;
var value_0 = __koru_input.value_0;
var value_1 = __koru_input.value_1;
var value_2 = __koru_input.value_2;
var value_3 = __koru_input.value_3;
var value_4 = __koru_input.value_4;
var value_5 = __koru_input.value_5;
var value_6 = __koru_input.value_6;
var value_7 = __koru_input.value_7;
var value_8 = __koru_input.value_8;
var value_9 = __koru_input.value_9;
var value_10 = __koru_input.value_10;
var value_11 = __koru_input.value_11;
var value_12 = __koru_input.value_12;
var value_13 = __koru_input.value_13;
var value_14 = __koru_input.value_14;
var value_15 = __koru_input.value_15;
var value_16 = __koru_input.value_16;
var value_17 = __koru_input.value_17;
var value_18 = __koru_input.value_18;
var value_19 = __koru_input.value_19;
var value_20 = __koru_input.value_20;
var value_21 = __koru_input.value_21;
var value_22 = __koru_input.value_22;
var value_23 = __koru_input.value_23;
var value_24 = __koru_input.value_24;
var __koru_r = row;
switch (field) {
case 0: { __koru_store_ents.t00[__koru_r] = value_0; return new Output { tag = "t00", t00 = value_0 }; }
case 1: { __koru_store_ents.t01[__koru_r] = value_1; return new Output { tag = "t01", t01 = value_1 }; }
case 2: { __koru_store_ents.t02[__koru_r] = value_2; return new Output { tag = "t02", t02 = value_2 }; }
case 3: { __koru_store_ents.t03[__koru_r] = value_3; return new Output { tag = "t03", t03 = value_3 }; }
case 4: { __koru_store_ents.t10[__koru_r] = value_4; return new Output { tag = "t10", t10 = value_4 }; }
case 5: { __koru_store_ents.t11[__koru_r] = value_5; return new Output { tag = "t11", t11 = value_5 }; }
case 6: { __koru_store_ents.t12[__koru_r] = value_6; return new Output { tag = "t12", t12 = value_6 }; }
case 7: { __koru_store_ents.t13[__koru_r] = value_7; return new Output { tag = "t13", t13 = value_7 }; }
case 8: { __koru_store_ents.t20[__koru_r] = value_8; return new Output { tag = "t20", t20 = value_8 }; }
case 9: { __koru_store_ents.t21[__koru_r] = value_9; return new Output { tag = "t21", t21 = value_9 }; }
case 10: { __koru_store_ents.t22[__koru_r] = value_10; return new Output { tag = "t22", t22 = value_10 }; }
case 11: { __koru_store_ents.t23[__koru_r] = value_11; return new Output { tag = "t23", t23 = value_11 }; }
case 12: { __koru_store_ents.t30[__koru_r] = value_12; return new Output { tag = "t30", t30 = value_12 }; }
case 13: { __koru_store_ents.t31[__koru_r] = value_13; return new Output { tag = "t31", t31 = value_13 }; }
case 14: { __koru_store_ents.t32[__koru_r] = value_14; return new Output { tag = "t32", t32 = value_14 }; }
case 15: { __koru_store_ents.t33[__koru_r] = value_15; return new Output { tag = "t33", t33 = value_15 }; }
case 16: { __koru_store_ents.px[__koru_r] = value_16; return new Output { tag = "px", px = value_16 }; }
case 17: { __koru_store_ents.py[__koru_r] = value_17; return new Output { tag = "py", py = value_17 }; }
case 18: { __koru_store_ents.pz[__koru_r] = value_18; return new Output { tag = "pz", pz = value_18 }; }
case 19: { __koru_store_ents.rx[__koru_r] = value_19; return new Output { tag = "rx", rx = value_19 }; }
case 20: { __koru_store_ents.ry[__koru_r] = value_20; return new Output { tag = "ry", ry = value_20 }; }
case 21: { __koru_store_ents.rz[__koru_r] = value_21; return new Output { tag = "rz", rz = value_21 }; }
case 22: { __koru_store_ents.vx[__koru_r] = value_22; return new Output { tag = "vx", vx = value_22 }; }
case 23: { __koru_store_ents.vy[__koru_r] = value_23; return new Output { tag = "vy", vy = value_23 }; }
case 24: { __koru_store_ents.vz[__koru_r] = value_24; return new Output { tag = "vz", vz = value_24 }; }
}
throw new global::System.Exception("__store_apply_ents: field index " + field + " is not a column of store 'ents'");
return default;
}
}
public static class __store_sweepbody_ents_L48_690_119_flattened_mat4_vec3_row_input_bd70bf_event {
public struct Input {
public double __koru_srf_e_L48_t00;
public double __koru_srf_e_L48_t33;
public double __koru_srf_e_L48_px;
public double __koru_srf_e_L48_rz;
public double __koru_srf_e_L48_vz;
public long __koru_sdix_e_L48;
}
public static dynamic handler(Input __koru_input) {
var __koru_srf_e_L48_t00 = __koru_input.__koru_srf_e_L48_t00;
var __koru_srf_e_L48_t33 = __koru_input.__koru_srf_e_L48_t33;
var __koru_srf_e_L48_px = __koru_input.__koru_srf_e_L48_px;
var __koru_srf_e_L48_rz = __koru_input.__koru_srf_e_L48_rz;
var __koru_srf_e_L48_vz = __koru_input.__koru_srf_e_L48_vz;
var __koru_sdix_e_L48 = __koru_input.__koru_sdix_e_L48;
__koru_stdout_write("t00 " + __koru_str(__koru_srf_e_L48_t00) + " t33 " + __koru_str(__koru_srf_e_L48_t33) + " px " + __koru_str(__koru_srf_e_L48_px) + " rz " + __koru_str(__koru_srf_e_L48_rz) + " vz " + __koru_str(__koru_srf_e_L48_vz) + "\n");
return default;
}
}
public static class __store_sweeprun_ents_L48_690_119_flattened_mat4_vec3_row_input_bd70bf_event {
public struct Input {
}
public static dynamic handler(Input __koru_input) {
{
for (var __koru_si = 0; __koru_si < __koru_store_ents.len; __koru_si++) {
var __koru_srf_e_L48_t00 = __koru_store_ents.t00[__koru_si];
var __koru_srf_e_L48_t33 = __koru_store_ents.t33[__koru_si];
var __koru_srf_e_L48_px = __koru_store_ents.px[__koru_si];
var __koru_srf_e_L48_rz = __koru_store_ents.rz[__koru_si];
var __koru_srf_e_L48_vz = __koru_store_ents.vz[__koru_si];
main_module.__store_sweepbody_ents_L48_690_119_flattened_mat4_vec3_row_input_bd70bf_event.handler(new main_module.__store_sweepbody_ents_L48_690_119_flattened_mat4_vec3_row_input_bd70bf_event.Input { __koru_srf_e_L48_t00 = __koru_srf_e_L48_t00, __koru_srf_e_L48_t33 = __koru_srf_e_L48_t33, __koru_srf_e_L48_px = __koru_srf_e_L48_px, __koru_srf_e_L48_rz = __koru_srf_e_L48_rz, __koru_srf_e_L48_vz = __koru_srf_e_L48_vz, __koru_sdix_e_L48 = __koru_si });
}
}
return default;
}
}
public static class std_io_print_ln_event {
public struct Input {
public dynamic expr;
public dynamic invocation;
public dynamic item;
public dynamic program;
public dynamic reporter;
public dynamic allocator;
}
public static dynamic handler(Input __koru_input) {
var expr = __koru_input.expr;
var invocation = __koru_input.invocation;
var item = __koru_input.item;
var program = __koru_input.program;
var reporter = __koru_input.reporter;
var allocator = __koru_input.allocator;
throw new global::System.Exception("ln: [transform] tor is lowered at compile time and must never be called");
}
}
public static void flow0() {
{
var __koru_p_t00 = (double)(1.0);
var __koru_p_t01 = (double)(0.0);
var __koru_p_t02 = (double)(0.0);
var __koru_p_t03 = (double)(0.0);
var __koru_p_t10 = (double)(0.0);
var __koru_p_t11 = (double)(1.0);
var __koru_p_t12 = (double)(0.0);
var __koru_p_t13 = (double)(0.0);
var __koru_p_t20 = (double)(0.0);
var __koru_p_t21 = (double)(0.0);
var __koru_p_t22 = (double)(1.0);
var __koru_p_t23 = (double)(0.0);
var __koru_p_t30 = (double)(0.0);
var __koru_p_t31 = (double)(0.0);
var __koru_p_t32 = (double)(0.0);
var __koru_p_t33 = (double)(1.0);
var __koru_p_px = (double)(1.0);
var __koru_p_py = (double)(2.0);
var __koru_p_pz = (double)(3.0);
var __koru_p_rx = (double)(0.0);
var __koru_p_ry = (double)(0.0);
var __koru_p_rz = (double)(0.0);
var __koru_p_vx = (double)(0.5);
var __koru_p_vy = (double)(0.25);
var __koru_p_vz = (double)(0.125);
var __koru_p___site_line = (long)(27);
if (__koru_store_ents.len >= 4) throw new global::System.Exception("std/store: store 'ents' is full (capacity 4) - declared capacity and the `| full` branch are pinned at 690_011");
long __koru_new_row = __koru_store_ents.len;
__koru_store_ents.t00[__koru_new_row] = __koru_p_t00;
__koru_store_ents.t01[__koru_new_row] = __koru_p_t01;
__koru_store_ents.t02[__koru_new_row] = __koru_p_t02;
__koru_store_ents.t03[__koru_new_row] = __koru_p_t03;
__koru_store_ents.t10[__koru_new_row] = __koru_p_t10;
__koru_store_ents.t11[__koru_new_row] = __koru_p_t11;
__koru_store_ents.t12[__koru_new_row] = __koru_p_t12;
__koru_store_ents.t13[__koru_new_row] = __koru_p_t13;
__koru_store_ents.t20[__koru_new_row] = __koru_p_t20;
__koru_store_ents.t21[__koru_new_row] = __koru_p_t21;
__koru_store_ents.t22[__koru_new_row] = __koru_p_t22;
__koru_store_ents.t23[__koru_new_row] = __koru_p_t23;
__koru_store_ents.t30[__koru_new_row] = __koru_p_t30;
__koru_store_ents.t31[__koru_new_row] = __koru_p_t31;
__koru_store_ents.t32[__koru_new_row] = __koru_p_t32;
__koru_store_ents.t33[__koru_new_row] = __koru_p_t33;
__koru_store_ents.px[__koru_new_row] = __koru_p_px;
__koru_store_ents.py[__koru_new_row] = __koru_p_py;
__koru_store_ents.pz[__koru_new_row] = __koru_p_pz;
__koru_store_ents.rx[__koru_new_row] = __koru_p_rx;
__koru_store_ents.ry[__koru_new_row] = __koru_p_ry;
__koru_store_ents.rz[__koru_new_row] = __koru_p_rz;
__koru_store_ents.vx[__koru_new_row] = __koru_p_vx;
__koru_store_ents.vy[__koru_new_row] = __koru_p_vy;
__koru_store_ents.vz[__koru_new_row] = __koru_p_vz;
__koru_store_ents.len += 1;
}
}
public static void flow1() {
{
var __koru_p_t00 = (double)(2.0);
var __koru_p_t01 = (double)(0.0);
var __koru_p_t02 = (double)(0.0);
var __koru_p_t03 = (double)(0.0);
var __koru_p_t10 = (double)(0.0);
var __koru_p_t11 = (double)(2.0);
var __koru_p_t12 = (double)(0.0);
var __koru_p_t13 = (double)(0.0);
var __koru_p_t20 = (double)(0.0);
var __koru_p_t21 = (double)(0.0);
var __koru_p_t22 = (double)(2.0);
var __koru_p_t23 = (double)(0.0);
var __koru_p_t30 = (double)(0.0);
var __koru_p_t31 = (double)(0.0);
var __koru_p_t32 = (double)(0.0);
var __koru_p_t33 = (double)(4.0);
var __koru_p_px = (double)(10.0);
var __koru_p_py = (double)(20.0);
var __koru_p_pz = (double)(30.0);
var __koru_p_rx = (double)(0.0);
var __koru_p_ry = (double)(0.0);
var __koru_p_rz = (double)(1.5);
var __koru_p_vx = (double)(5.0);
var __koru_p_vy = (double)(2.5);
var __koru_p_vz = (double)(1.25);
var __koru_p___site_line = (long)(37);
if (__koru_store_ents.len >= 4) throw new global::System.Exception("std/store: store 'ents' is full (capacity 4) - declared capacity and the `| full` branch are pinned at 690_011");
long __koru_new_row = __koru_store_ents.len;
__koru_store_ents.t00[__koru_new_row] = __koru_p_t00;
__koru_store_ents.t01[__koru_new_row] = __koru_p_t01;
__koru_store_ents.t02[__koru_new_row] = __koru_p_t02;
__koru_store_ents.t03[__koru_new_row] = __koru_p_t03;
__koru_store_ents.t10[__koru_new_row] = __koru_p_t10;
__koru_store_ents.t11[__koru_new_row] = __koru_p_t11;
__koru_store_ents.t12[__koru_new_row] = __koru_p_t12;
__koru_store_ents.t13[__koru_new_row] = __koru_p_t13;
__koru_store_ents.t20[__koru_new_row] = __koru_p_t20;
__koru_store_ents.t21[__koru_new_row] = __koru_p_t21;
__koru_store_ents.t22[__koru_new_row] = __koru_p_t22;
__koru_store_ents.t23[__koru_new_row] = __koru_p_t23;
__koru_store_ents.t30[__koru_new_row] = __koru_p_t30;
__koru_store_ents.t31[__koru_new_row] = __koru_p_t31;
__koru_store_ents.t32[__koru_new_row] = __koru_p_t32;
__koru_store_ents.t33[__koru_new_row] = __koru_p_t33;
__koru_store_ents.px[__koru_new_row] = __koru_p_px;
__koru_store_ents.py[__koru_new_row] = __koru_p_py;
__koru_store_ents.pz[__koru_new_row] = __koru_p_pz;
__koru_store_ents.rx[__koru_new_row] = __koru_p_rx;
__koru_store_ents.ry[__koru_new_row
... [truncated - 21KB total]Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (ents, capacity: 4, source: t00: f64, t01: f64, t02: f64, t03: f64,
t10: f64, t11: f64, t12: f64, t13: f64,
t20: f64, t21: f64, t22: f64, t23: f64,
t30: f64, t31: f64, t32: f64, t33: f64,
px: f64, py: f64, pz: f64,
rx: f64, ry: f64, rz: f64,
vx: f64, vy: f64, vz: f64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (ents, source: t00: 1.0, t01: 0.0, t02: 0.0, t03: 0.0,
t10: 0.0, t11: 1.0, t12: 0.0, t13: 0.0,
t20: 0.0, t21: 0.0, t22: 1.0, t23: 0.0,
t30: 0.0, t31: 0.0, t32: 0.0, t33: 1.0,
px: 1.0, py: 2.0, pz: 3.0,
rx: 0.0, ry: 0.0, rz: 0.0,
vx: 0.5, vy: 0.25, vz: 0.125)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (ents, source: t00: 2.0, t01: 0.0, t02: 0.0, t03: 0.0,
t10: 0.0, t11: 2.0, t12: 0.0, t13: 0.0,
t20: 0.0, t21: 0.0, t22: 2.0, t23: 0.0,
t30: 0.0, t31: 0.0, t32: 0.0, t33: 4.0,
px: 10.0, py: 20.0, pz: 30.0,
rx: 0.0, ry: 0.0, rz: 1.5,
vx: 5.0, vy: 2.5, vz: 1.25)
flow ~query click a branch to expand · @labels scroll to their anchor
query (ents)
Test Configuration
MUST_RUN LANGUAGES: zig cs