✓
Passing This code compiles and runs correctly.
Code
// TEST: kernel layout metadata (aspirational)
//
// Goal:
// 1. The kernel view should expose a layout hint (AoS/SoA/Hybrid)
// 2. The compiler should fill this from analysis of the continuation subtree
//
// NOTE: layout is currently stubbed to "aos" until analysis is implemented.
// This test verifies that computed branch receives correct slice length.
import std/kernel
import std/io
std/kernel:shape(Body) {
x: f64,
y: f64,
mass: f64,
}
std/kernel:init(Body) {
{ x: 0.0, y: 0.0, mass: 1.0 },
{ x: 1.0, y: 0.0, mass: 2.0 },
}
| kernel k |> std/kernel:self { k.mass *= 1.0 }
| computed c |> std/io:print.blk {
slice len={{ c.len:d }}, mass[0]={{ c[0].mass:f }}
}
Actual
slice len=2, mass[0]=1
Expected output
slice len=2, mass[0]=1
Flows
flow ~shape click a branch to expand · @labels scroll to their anchor
shape (expr: Body, source: x: f64,
y: f64,
mass: f64,)
flow ~init click a branch to expand · @labels scroll to their anchor
init (expr: Body, source: { x: 0.0, y: 0.0, mass: 1.0 },
{ x: 1.0, y: 0.0, mass: 2.0 },)
Test Configuration
MUST_RUN