✓
Passing This code compiles and runs correctly.
Code
// PINS `[layout(row)]`: the two grid layouts are OBSERVATIONALLY IDENTICAL.
//
// A grid's cells are stored one array per field (`column`, the default) or one
// record per cell (`row`). That choice is a pure codegen decision and this test
// is the thing that says so: the same writes, the same cross-cell read, and the
// same guarded sweep run over both, and the two totals must agree. If they ever
// diverge, the layout has become semantically visible and that is a bug in the
// lowering, not a tuning question.
//
// WHY THE CHOICE EXISTS. Column layout puts each field in its own array, which
// is what a dense sweep over ONE field wants and what lets it vectorise. Row
// layout packs a cell's fields together, which is what a SCATTER wants -- many
// fields of one cell at a computed index, touching one cache line instead of
// one per field.
//
// BOTH DIRECTIONS ARE MEASURED, and the sign flips hard:
//
// scatter-dominated (003_ecs_reactive boids, 100k boids into a 32768-cell
// grid, interleaved, checksum 592303452 both ways)
// column 98.7ms row 91.5ms -- row wins by 7%
//
// sweep-dominated (004_grid_layout, nine i64 fields, 1M cells, 400 sweeps
// reading one field, same total both ways)
// column 0.04s row 0.45s -- column wins by 11x
//
// That second number is why this is a declaration and not a default anyone
// gets to pick centrally, and it is checked in as a runnable pair rather than
// quoted here, so the losing direction cannot quietly rot while the winning
// one stays on the board.
//
// It is spelled as an annotation for the same reasons `[unsafe(bounds)]` is:
// it describes how the table is compiled rather than what it holds, the
// language already has a form for that, and it NAMES the choice so a typo is
// refused (697_011) instead of silently keeping the layout you meant to change.
//
// The store design already ruled this -- "layout is the closure of the queries"
// -- and this is the first rung of honouring it. The annotation lands before
// any inference so the choice is available and measurable, and it stays
// afterwards as the override.
//
// Both grids also carry a MULTI-FIELD cell and a cross-cell read
// (`g[6].a: g[2].a + 1`), because a single-field grid would not distinguish the
// two layouts at all and a same-cell read would not exercise the address form.
import std/io
import std/store
import std/grid
std/grid:new(colg, size: 8) { a: 0[i64], b: 0[i64] }
[layout(row)]std/grid:new(rowg, size: 8) { a: 0[i64], b: 0[i64] }
[layout(column)]std/grid:new(explicitg, size: 8) { a: 0[i64], b: 0[i64] }
std/store:new(acc) { n: 0[i64], m: 0[i64], e: 0[i64] }
std/grid:stored { colg[2].a: 5, colg[2].b: 7 }
std/grid:stored { rowg[2].a: 5, rowg[2].b: 7 }
std/grid:stored { explicitg[2].a: 5, explicitg[2].b: 7 }
std/grid:stored { colg[6].a: colg[2].a + 1 }
std/grid:stored { rowg[6].a: rowg[2].a + 1 }
std/grid:stored { explicitg[6].a: explicitg[2].a + 1 }
std/grid:sweep(colg)
! sweep c when c.a > 0 |> std/store:stored { acc.n: acc.n + c.a * 10 + c.b }
std/grid:sweep(rowg)
! sweep c when c.a > 0 |> std/store:stored { acc.m: acc.m + c.a * 10 + c.b }
std/grid:sweep(explicitg)
! sweep c when c.a > 0 |> std/store:stored { acc.e: acc.e + c.a * 10 + c.b }
std/io:print.ln("column {{ acc.n:d }} row {{ acc.m:d }} explicit {{ acc.e:d }}")
Actual
column 117 row 117 explicit 117
Expected output
✓ Zig✓ JavaScriptcolumn 117 row 117 explicit 117
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 {
const __KoruGridT_colg = struct {
a: [8]i64 = [_]i64{0} ** 8,
b: [8]i64 = [_]i64{0} ** 8,
const __koru_size: usize = 8;
fn __koru_wide(v: anytype) i64 {
return if (@TypeOf(v) == comptime_int) v else @intCast(v);
}
fn __koru_at(i_raw: anytype) usize {
const i = __koru_wide(i_raw);
if (i < 0 or @as(usize, @intCast(i)) >= 8) @panic("std/grid: index out of range for grid 'colg' (size 8) - a grid is addressed by position, and wrapping is the program's to write as `% 8`");
return @as(usize, @intCast(i));
}
};
var __koru_grid_colg: __KoruGridT_colg = .{};
const __KoruGridT_rowg = struct {
const __KoruCell = struct {
a: i64 = 0,
b: i64 = 0,
};
__koru_row: [8]__KoruCell = [_]__KoruCell{.{}} ** 8,
const __koru_size: usize = 8;
fn __koru_wide(v: anytype) i64 {
return if (@TypeOf(v) == comptime_int) v else @intCast(v);
}
fn __koru_at(i_raw: anytype) usize {
const i = __koru_wide(i_raw);
if (i < 0 or @as(usize, @intCast(i)) >= 8) @panic("std/grid: index out of range for grid 'rowg' (size 8) - a grid is addressed by position, and wrapping is the program's to write as `% 8`");
return @as(usize, @intCast(i));
}
};
var __koru_grid_rowg: __KoruGridT_rowg = .{};
const __KoruGridT_explicitg = struct {
a: [8]i64 = [_]i64{0} ** 8,
b: [8]i64 = [_]i64{0} ** 8,
const __koru_size: usize = 8;
fn __koru_wide(v: anytype) i64 {
return if (@TypeOf(v) == comptime_int) v else @intCast(v);
}
fn __koru_at(i_raw: anytype) usize {
const i = __koru_wide(i_raw);
if (i < 0 or @as(usize, @intCast(i)) >= 8) @panic("std/grid: index out of range for grid 'explicitg' (size 8) - a grid is addressed by position, and wrapping is the program's to write as `% 8`");
return @as(usize, @intCast(i));
}
};
var __koru_grid_explicitg: __KoruGridT_explicitg = .{};
// std/store: 'acc' created (cell + write-subflow at module scope); fields n: i64, m: i64, e: i64
// >>> FLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:55 ~input:__grid_write_L55_4806()
pub fn flow0() void {
_ = main_module.__grid_write_L55_4806_event.handler(.{ .__koru_gwx0 = main_module.__KoruGridT_colg.__koru_wide(2), .__koru_gwv0 = 5, .__koru_gwx1 = main_module.__KoruGridT_colg.__koru_wide(2), .__koru_gwv1 = 7 });
}
// >>> FLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:56 ~input:__grid_write_L56_c48c()
pub fn flow1() void {
_ = main_module.__grid_write_L56_c48c_event.handler(.{ .__koru_gwx0 = main_module.__KoruGridT_rowg.__koru_wide(2), .__koru_gwv0 = 5, .__koru_gwx1 = main_module.__KoruGridT_rowg.__koru_wide(2), .__koru_gwv1 = 7 });
}
// >>> FLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:57 ~input:__grid_write_L57_8278()
pub fn flow2() void {
_ = main_module.__grid_write_L57_8278_event.handler(.{ .__koru_gwx0 = main_module.__KoruGridT_explicitg.__koru_wide(2), .__koru_gwv0 = 5, .__koru_gwx1 = main_module.__KoruGridT_explicitg.__koru_wide(2), .__koru_gwv1 = 7 });
}
// >>> FLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:59 ~input:__grid_write_L59_a335()
pub fn flow3() void {
_ = main_module.__grid_write_L59_a335_event.handler(.{ .__koru_gwx0 = main_module.__KoruGridT_colg.__koru_wide(6), .__koru_gwv0 = (&main_module.__koru_grid_colg.a)[main_module.__KoruGridT_colg.__koru_at(2)] + 1 });
}
// >>> FLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:60 ~input:__grid_write_L60_e15f()
pub fn flow4() void {
_ = main_module.__grid_write_L60_e15f_event.handler(.{ .__koru_gwx0 = main_module.__KoruGridT_rowg.__koru_wide(6), .__koru_gwv0 = (&main_module.__koru_grid_rowg.__koru_row)[main_module.__KoruGridT_rowg.__koru_at(2)].a + 1 });
}
// >>> FLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:61 ~input:__grid_write_L61_c233()
pub fn flow5() void {
_ = main_module.__grid_write_L61_c233_event.handler(.{ .__koru_gwx0 = main_module.__KoruGridT_explicitg.__koru_wide(6), .__koru_gwv0 = (&main_module.__koru_grid_explicitg.a)[main_module.__KoruGridT_explicitg.__koru_at(2)] + 1 });
}
// >>> FLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:63 ~input:__grid_sweep_L63()
pub fn flow6() void {
_ = main_module.__grid_sweep_L63_event.handler(.{ });
}
// >>> FLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:66 ~input:__grid_sweep_L66()
pub fn flow7() void {
_ = main_module.__grid_sweep_L66_event.handler(.{ });
}
// >>> FLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:69 ~input:__grid_sweep_L69()
pub fn flow8() void {
_ = main_module.__grid_sweep_L69_event.handler(.{ });
}
// >>> FLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:72 ~std.io:print.impl()
pub fn flow9() void {
(struct { fn __kout(__fd: i32, __b: []const u8) void { if (@import("builtin").os.tag == .freestanding) { const __kc = struct { extern var stdout: ?*anyopaque; extern var stderr: ?*anyopaque; extern fn fputs(__s: [*:0]const u8, __st: ?*anyopaque) c_int; }; var __kt: [4096]u8 = undefined; for (0..(__b.len + __kt.len - 2) / (__kt.len - 1)) |__ki| { const __kn = @min(__kt.len - 1, __b.len - __ki * (__kt.len - 1)); @memcpy(__kt[0..__kn], __b[__ki * (__kt.len - 1)..][0..__kn]); __kt[__kn] = 0; @import("std").mem.doNotOptimizeAway(__kc.fputs(@as([*:0]const u8, @ptrCast(&__kt)), if (__fd == 2) __kc.stderr else __kc.stdout)); } } else { @import("std").mem.doNotOptimizeAway(@import("std").posix.write(__fd, __b) catch @as(usize, 0)); } } fn __kw(comptime __f: []const u8, __a: anytype) void { var __kb: [65536]u8 = undefined; const __ks = @import("std").fmt.bufPrint(&__kb, __f, __a) catch __kb[0..0]; __kout(1, __ks); } }).__kw("column {d} row {d} explicit {d}\n", .{__koru_store_acc.n, __koru_store_acc.m, __koru_store_acc.e});
}
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_acc = blk: {
const __info = @typeInfo(@TypeOf(.{ .n = @as(i64, 0), .m = @as(i64, 0), .e = @as(i64, 0) }));
var __fields: [__info.@"struct".fields.len]@import("std").builtin.Type.StructField = undefined;
for (__info.@"struct".fields, 0..) |__f, __i| {
__fields[__i] = .{ .name = __f.name, .type = __f.type, .default_value_ptr = null, .is_comptime = false, .alignment = __f.alignment };
}
break :blk @Type(.{ .@"struct" = .{ .layout = .auto, .fields = &__fields, .decls = &.{}, .is_tuple = false } });
};
var __koru_store_acc: __KoruStoreT_acc = .{ .n = @as(i64, 0), .m = @as(i64, 0), .e = @as(i64, 0) };
pub const __store_apply_acc_event = struct {
pub const Input = struct {
field: i64,
value: i64,
};
pub const Output = union(enum(u8)) {
n: i64,
m: i64,
e: i64,
};
pub inline fn handler(__koru_event_input: @This().Input) @This().Output {
return __koru_handler_impl(__koru_event_input.field, __koru_event_input.value);
}
fn __koru_handler_impl(__koru_p_0: i64, __koru_p_1: i64) @This().Output {
const __koru_event_input: @This().Input = .{ .field = __koru_p_0, .value = __koru_p_1 };
// >>> PROC: __store_apply_acc [tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:53]
const field = __koru_event_input.field;
const value = __koru_event_input.value;
_ = &field;
_ = &value;
_ = &__koru_event_input;
return switch (field) {
0 => blk: { __koru_store_acc.n = value; break :blk .{ .n = value }; },
1 => blk: { __koru_store_acc.m = value; break :blk .{ .m = value }; },
2 => blk: { __koru_store_acc.e = value; break :blk .{ .e = value }; },
else => unreachable,
};
}
};
pub const __store_write_acc_event = struct {
pub const Input = struct {
field: i64,
value: i64,
};
pub const Output = void;
pub inline fn handler(__koru_event_input: @This().Input) @This().Output {
return __koru_handler_impl(__koru_event_input.field, __koru_event_input.value);
}
fn __koru_handler_impl(__koru_p_0: i64, __koru_p_1: i64) @This().Output {
const __koru_event_input: @This().Input = .{ .field = __koru_p_0, .value = __koru_p_1 };
// >>> SUBFLOW: tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:53
const field = __koru_event_input.field;
const value = __koru_event_input.value;
_ = &field;
_ = &value;
_ = &__koru_event_input;
const result = main_module.__store_apply_acc_event.handler(.{ .field = field, .value = value });
return switch (result) {
.n => {},
.e => {},
.m => {},
};
}
};
pub const __store_announce_acc_event = struct {
pub const Input = struct {
field: i64,
};
pub const Output = void;
pub inline fn handler(__koru_event_input: @This().Input) @This().Output {
return __koru_handler_impl(__koru_event_input.field);
}
fn __koru_handler_impl(__koru_p_0: i64) @This().Output {
const __koru_event_input: @This().Input = .{ .field = __koru_p_0 };
// >>> PROC: __store_announce_acc [tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:53]
const field = __koru_event_input.field;
_ = &field;
_ = &__koru_event_input;
return;
}
};
pub const __grid_write_L55_4806_event = struct {
pub const Input = struct {
__koru_gwx0: i64,
__koru_gwv0: i64,
__koru_gwx1: i64,
__koru_gwv1: i64,
};
pub const Output = void;
pub inline fn handler(__koru_event_input: @This().Input) @This().Output {
return __koru_handler_impl(__koru_event_input.__koru_gwx0, __koru_event_input.__koru_gwv0, __koru_event_input.__koru_gwx1, __koru_event_input.__koru_gwv1);
}
fn __koru_handler_impl(__koru_p_0: i64, __koru_p_1: i64, __koru_p_2: i64, __koru_p_3: i64) @This().Output {
const __koru_event_input: @This().Input = .{ .__koru_gwx0 = __koru_p_0, .__koru_gwv0 = __koru_p_1, .__koru_gwx1 = __koru_p_2, .__koru_gwv1 = __koru_p_3 };
// >>> PROC: __grid_write_L55_4806 [tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:55]
const __koru_gwx0 = __koru_event_input.__koru_gwx0;
const __koru_gwv0 = __koru_event_input.__koru_gwv0;
const __koru_gwx1 = __koru_event_input.__koru_gwx1;
const __koru_gwv1 = __koru_event_input.__koru_gwv1;
_ = &__koru_gwx0;
_ = &__koru_gwv0;
_ = &__koru_gwx1;
_ = &__koru_gwv1;
_ = &__koru_event_input;
(&main_module.__koru_grid_colg.a)[main_module.__KoruGridT_colg.__koru_at(__koru_gwx0)] = __koru_gwv0;
(&main_module.__koru_grid_colg.b)[main_module.__KoruGridT_colg.__koru_at(__koru_gwx1)] = __koru_gwv1;
}
};
pub const __grid_write_L56_c48c_event = struct {
pub const Input = struct {
__koru_gwx0: i64,
__koru_gwv0: i64,
__koru_gwx1: i64,
__koru_gwv1: i64,
};
pub const Output = void;
pub inline fn handler(__koru_event_input: @This().Input) @This().Output {
return __koru_handler_impl(__koru_event_input.__koru_gwx0, __koru_event_input.__koru_gwv0, __koru_event_input.__koru_gwx1, __koru_event_input.__koru_gwv1);
}
fn __koru_handler_impl(__koru_p_0: i64, __koru_p_1: i64, __koru_p_2: i64, __koru_p_3: i64) @This().Output {
const __koru_event_input: @This().Input = .{ .__koru_gwx0 = __koru_p_0, .__koru_gwv0 = __koru_p_1, .__koru_gwx1 = __koru_p_2, .__koru_gwv1 = __koru_p_3 };
// >>> PROC: __grid_write_L56_c48c [tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:56]
const __koru_gwx0 = __koru_event_input.__koru_gwx0;
const __koru_gwv0 = __koru_event_input.__koru_gwv0;
const __koru_gwx1 = __koru_event_input.__koru_gwx1;
const __koru_gwv1 = __koru_event_input.__koru_gwv1;
_ = &__koru_gwx0;
_ = &__koru_gwv0;
_ = &__koru_gwx1;
_ = &__koru_gwv1;
_ = &__koru_event_input;
(&main_module.__koru_grid_rowg.__koru_row)[main_module.__KoruGridT_rowg.__koru_at(__koru_gwx0)].a = __koru_gwv0;
(&main_module.__koru_grid_rowg.__koru_row)[main_module.__KoruGridT_rowg.__koru_at(__koru_gwx1)].b = __koru_gwv1;
}
};
pub const __grid_write_L57_8278_event = struct {
pub const Input = struct {
__koru_gwx0: i64,
__koru_gwv0: i64,
__koru_gwx1: i64,
__koru_gwv1: i64,
};
pub const Output = void;
pub inline fn handler(__koru_event_input: @This().Input) @This().Output {
return __koru_handler_impl(__koru_event_input.__koru_gwx0, __koru_event_input.__koru_gwv0, __koru_event_input.__koru_gwx1, __koru_event_input.__koru_gwv1);
}
fn __koru_handler_impl(__koru_p_0: i64, __koru_p_1: i64, __koru_p_2: i64, __koru_p_3: i64) @This().Output {
const __koru_event_input: @This().Input = .{ .__koru_gwx0 = __koru_p_0, .__koru_gwv0 = __koru_p_1, .__koru_gwx1 = __koru_p_2, .__koru_gwv1 = __koru_p_3 };
// >>> PROC: __grid_write_L57_8278 [tests/regression/600_STDLIB/697_GRID/697_010_grid_layout_row_and_column_agree/input.k:57]
const __koru_gwx0 = __koru_event_input.__koru_gwx0;
const __koru_gwv0 = __koru_event_input.__koru_gwv0;
const __koru_gwx1 = __koru_event_input.__koru_gwx1;
const __koru_gwv1 = __koru_event_input.__koru_gwv1;
_ = &__koru_gwx0;
_ = &__koru_gwv0;
_ = &__koru_gwx1;
_ = &__koru_gwv1;
_ = &__koru_event_input;
(&main_module.__koru_grid_explicitg.a)[main_module.__KoruGridT_explicitg.__koru_at(__koru_gwx0)] = __koru_gwv0;
(&main_module.__koru_grid_explicitg
... [truncated - 29KB total]Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (colg, size: 8, source: a: 0[i64], b: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (rowg, size: 8, source: a: 0[i64], b: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (explicitg, size: 8, source: a: 0[i64], b: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (acc, source: n: 0[i64], m: 0[i64], e: 0[i64])
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: colg[2].a: 5, colg[2].b: 7)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: rowg[2].a: 5, rowg[2].b: 7)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: explicitg[2].a: 5, explicitg[2].b: 7)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: colg[6].a: colg[2].a + 1)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: rowg[6].a: rowg[2].a + 1)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: explicitg[6].a: explicitg[2].a + 1)
flow ~sweep click a branch to expand · @labels scroll to their anchor
sweep (colg)
flow ~sweep click a branch to expand · @labels scroll to their anchor
sweep (rowg)
flow ~sweep click a branch to expand · @labels scroll to their anchor
sweep (explicitg)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "column {{ acc.n:d }} row {{ acc.m:d }} explicit {{ acc.e:d }}")
Test Configuration
MUST_RUN LANGUAGES: zig js