From 8da068cc1f66cdd7fe538e389bf7369fa05959e5 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Fri, 9 Oct 2026 21:03:06 +0200 Subject: [PATCH] test(runtime): extend qualified layer caller and stage diagnostics --- .../leleka-runtime/src/qwen_forward/executor.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/leleka-runtime/src/qwen_forward/executor.rs b/crates/leleka-runtime/src/qwen_forward/executor.rs index 3a25450a..53deac9d 100644 --- a/crates/leleka-runtime/src/qwen_forward/executor.rs +++ b/crates/leleka-runtime/src/qwen_forward/executor.rs @@ -58,6 +58,8 @@ impl QwenForward { let mut previous = None; for descriptor in binding.ordered_layers() { + #[cfg(test)] + eprintln!("integration: starting layer {}", descriptor.index()); let layer = LayerId::new(u64::from(descriptor.index()), layer_bound)?; let residual = read_layer_attention(binding, layer, previous.as_ref(), txn)?; let injected = match descriptor.kind() { @@ -234,7 +236,7 @@ mod tests { #[cfg(all(target_os = "linux", target_arch = "x86_64"))] #[test] #[ignore = "requires the two exact pinned IQ3_S GGUF shards and an available NVIDIA GPU"] - fn pinned_artifact_prefix_reaches_qsa_after_real_moe_without_state_commit() { + fn pinned_artifact_layers_reach_missing_output_without_state_commit() { use crate::model_binding::qwen4exp_input::ModelBinding; use leleka_cuda_driver::Driver; use leleka_model_format::{gguf::VerifiedGgufFile, qwen4exp::Qwen4ExpArtifact}; @@ -278,7 +280,7 @@ mod tests { let identity = binding.identity(); assert_eq!( QwenForward::step(&binding, token, position, &mut session), - Err(Error::Unsupported(Stage::QsaIndex)) + Err(Error::Unsupported(Stage::Output)) ); // Verify rollback in a no-GPU transaction at the same position. The @@ -286,9 +288,12 @@ mod tests { let state_probe = session.transact(token, position, &identity, |txn| { assert_eq!(txn.input_predecessors()?, [-1, -1]); let layers = Dimension::new(u64::from(binding.layer_count()))?; - for index in 0..3 { - let layer = LayerId::new(index, layers)?; - assert_eq!(txn.gdn_prior(layer)?.next_position(), 0); + for descriptor in binding.ordered_layers() { + let layer = LayerId::new(u64::from(descriptor.index()), layers)?; + match descriptor.kind() { + BoundLayerKind::Gdn => assert_eq!(txn.gdn_prior(layer)?.next_position(), 0), + BoundLayerKind::Qsa => assert_eq!(txn.qsa_prior(layer)?.next_position(), 0), + } } assert_eq!(txn.ple_prior()?.next_position(), 0); Err(Error::NonFinite)