Hoist a batch input only where the compiler proves it cannot vary per lane

This commit is contained in:
Dennis Kobert
2026-08-25 20:09:12 +00:00
parent 95bbeb6634
commit d452ac0de1
8 changed files with 145 additions and 40 deletions

View File

@@ -601,7 +601,13 @@ mod tests {
}
fn install<N: Node<ContextImpl<'static>>>(mut node: N, meta: core_types::record::LayoutMeta, inputs: &[Option<&Layout>]) -> N {
<N as Node<ContextImpl<'static>>>::set_layout(&mut node, meta.resolve(inputs));
// The fixtures wire constants into every eager input, which the compiler
// pass records as lane-invariant.
let resolved = core_types::record::RecordLayout {
lane_invariant: u32::MAX,
..meta.resolve(inputs)
};
<N as Node<ContextImpl<'static>>>::set_layout(&mut node, resolved);
node
}
@@ -610,6 +616,7 @@ mod tests {
frame_bytes: layout.frame_bytes(),
plan: Vec::new(),
layout: layout.clone(),
lane_invariant: u32::MAX,
};
<N as Node<ContextImpl<'static>>>::set_layout(&mut node, bundle);
node

View File

@@ -288,7 +288,13 @@ mod tests {
}
fn install<N: Node<ContextImpl<'static>>>(mut node: N, meta: record::LayoutMeta, inputs: &[Option<&Layout>]) -> N {
<N as Node<ContextImpl<'static>>>::set_layout(&mut node, meta.resolve(inputs));
// The fixtures wire constants into every eager input, which the compiler
// pass records as lane-invariant.
let resolved = record::RecordLayout {
lane_invariant: u32::MAX,
..meta.resolve(inputs)
};
<N as Node<ContextImpl<'static>>>::set_layout(&mut node, resolved);
node
}
@@ -297,6 +303,7 @@ mod tests {
frame_bytes: layout.frame_bytes(),
plan: Vec::new(),
layout: layout.clone(),
lane_invariant: u32::MAX,
};
<N as Node<ContextImpl<'static>>>::set_layout(&mut node, bundle);
node

View File

@@ -278,6 +278,7 @@ mod tests {
frame_bytes: layout.frame_bytes(),
plan: Vec::new(),
layout: layout.clone(),
lane_invariant: u32::MAX,
},
);
let GPoll::Final(result) = Node::<ContextImpl>::eval(&graph, &ctx) else {