From 75c06c0f4e6dd5d37645472ace8889097a19f8ed Mon Sep 17 00:00:00 2001 From: Justin Chu Date: Mon, 24 Aug 2026 15:43:54 +0000 Subject: [PATCH 1/2] test(engine): name the session fixture after what it declares, not after the banned symbol `CLI ORT` is red on `main` (Linux and Windows) and has been since #1982: crates/onnx-genai-engine/src/engine/runtime.rs: 7 use(s) of package-shape dispatch, allowance 0 crates/onnx-genai-engine/src/pipeline/generation.rs: 7 use(s) of package-shape dispatch, allowance 0 Neither file dispatches on package shape. `shape_dispatch_gate` counts `source.matches("WorkflowShape")`, a substring test, and #1982 added a test fixture enum named `TestWorkflowShape` -- 14 mentions, all of them the fixture. The fix is the name, not the gate, and not an allowance entry. The enum's own doc says what it models: "which of the three declarable session shapes a test fixture should build". Its variants are `Stateless`, `LoopCarriedSession`, `PromptPrefixConversation` -- three ways a package declares *session state*, which is a different axis from the workflow-vs-decoder split the gate bans. `TestSessionShape` is the accurate name and it removes the collision as a side effect. Adding the two files to `allowance()` was the other option and is worse: that table is documented as the remaining-work ledger that "must only ever shrink", and an allowance of 7 on `generation.rs` would also permit seven real reintroductions there. Verified both directions locally: * without the rename: `shape_dispatch_does_not_spread` FAILED, naming both files -- the CI failure reproduced. * with it: 2 passed. * `cargo test -p onnx-genai-engine --lib` -> 481 passed, 0 failed. * `cargo check -p onnx-genai-engine --features native-backend --all-targets` -> 0, which is where 7 of the 14 mentions live. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- crates/onnx-genai-engine/src/engine/runtime.rs | 14 +++++++------- .../onnx-genai-engine/src/pipeline/generation.rs | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/onnx-genai-engine/src/engine/runtime.rs b/crates/onnx-genai-engine/src/engine/runtime.rs index 75bbde33bb..6dbc3fac4b 100644 --- a/crates/onnx-genai-engine/src/engine/runtime.rs +++ b/crates/onnx-genai-engine/src/engine/runtime.rs @@ -2981,7 +2981,7 @@ mod tests { fn interpreted_engine_with_byte_budget(budget_bytes: u64) -> anyhow::Result { interpreted_engine_inner( budget_bytes, - crate::pipeline::generation::TestWorkflowShape::Stateless, + crate::pipeline::generation::TestSessionShape::Stateless, ) } @@ -2996,7 +2996,7 @@ mod tests { fn interpreted_session_engine_with_byte_budget(budget_bytes: u64) -> anyhow::Result { interpreted_engine_inner( budget_bytes, - crate::pipeline::generation::TestWorkflowShape::LoopCarriedSession, + crate::pipeline::generation::TestSessionShape::LoopCarriedSession, ) } @@ -3008,14 +3008,14 @@ mod tests { ) -> anyhow::Result { interpreted_engine_inner( budget_bytes, - crate::pipeline::generation::TestWorkflowShape::PromptPrefixConversation, + crate::pipeline::generation::TestSessionShape::PromptPrefixConversation, ) } #[cfg(feature = "native-backend")] fn interpreted_engine_inner( budget_bytes: u64, - shape: crate::pipeline::generation::TestWorkflowShape, + shape: crate::pipeline::generation::TestSessionShape, ) -> anyhow::Result { let tokenizer_path = Path::new(env!("CARGO_MANIFEST_DIR")) .join("../../tests/fixtures/tiny-llm/tokenizer.json") @@ -3034,13 +3034,13 @@ mod tests { )?; Ok(Engine { workflow: Box::new(match shape { - crate::pipeline::generation::TestWorkflowShape::Stateless => { + crate::pipeline::generation::TestSessionShape::Stateless => { crate::pipeline::generation::test_decoder_runtime()? } - crate::pipeline::generation::TestWorkflowShape::LoopCarriedSession => { + crate::pipeline::generation::TestSessionShape::LoopCarriedSession => { crate::pipeline::generation::test_session_decoder_runtime()? } - crate::pipeline::generation::TestWorkflowShape::PromptPrefixConversation => { + crate::pipeline::generation::TestSessionShape::PromptPrefixConversation => { crate::pipeline::generation::test_conversation_decoder_runtime()? } }), diff --git a/crates/onnx-genai-engine/src/pipeline/generation.rs b/crates/onnx-genai-engine/src/pipeline/generation.rs index 637c6921ff..af9303df65 100644 --- a/crates/onnx-genai-engine/src/pipeline/generation.rs +++ b/crates/onnx-genai-engine/src/pipeline/generation.rs @@ -925,7 +925,7 @@ fn loop_carried_cell_names( #[cfg(test)] pub(crate) fn test_decoder_runtime() -> anyhow::Result { - test_decoder_runtime_inner(TestWorkflowShape::Stateless) + test_decoder_runtime_inner(TestSessionShape::Stateless) } /// The same canonical decoder, declaring the conversation it carries. @@ -945,7 +945,7 @@ pub(crate) fn test_decoder_runtime() -> anyhow::Result { /// unrelated fixtures. #[cfg(all(test, feature = "native-backend"))] pub(crate) fn test_session_decoder_runtime() -> anyhow::Result { - test_decoder_runtime_inner(TestWorkflowShape::LoopCarriedSession) + test_decoder_runtime_inner(TestSessionShape::LoopCarriedSession) } /// A package whose session carries the conversation as a **prompt prefix**. @@ -967,13 +967,13 @@ pub(crate) fn test_session_decoder_runtime() -> anyhow::Result /// binding carries has no reader inside the workflow. #[cfg(all(test, feature = "native-backend"))] pub(crate) fn test_conversation_decoder_runtime() -> anyhow::Result { - test_decoder_runtime_inner(TestWorkflowShape::PromptPrefixConversation) + test_decoder_runtime_inner(TestSessionShape::PromptPrefixConversation) } /// Which of the three declarable session shapes a test fixture should build. #[cfg(test)] #[derive(Clone, Copy, PartialEq, Eq)] -pub(crate) enum TestWorkflowShape { +pub(crate) enum TestSessionShape { /// All state invocation-scoped: every turn restarts. Stateless, /// The cells the loop threads are session-scoped, so turns continue. @@ -984,7 +984,7 @@ pub(crate) enum TestWorkflowShape { } #[cfg(test)] -fn test_decoder_runtime_inner(shape: TestWorkflowShape) -> anyhow::Result { +fn test_decoder_runtime_inner(shape: TestSessionShape) -> anyhow::Result { let abi = onnx_genai_metadata::DecoderAbi { token_input: Some("input_ids".to_string()), logits_output: Some("logits".to_string()), @@ -1000,7 +1000,7 @@ fn test_decoder_runtime_inner(shape: TestWorkflowShape) -> anyhow::Result anyhow::Result Date: Mon, 24 Aug 2026 16:25:21 +0000 Subject: [PATCH 2/2] test(engine): carry the rename across #1996's new use of the old name #1996 landed while this was open and added a fifteenth mention of `TestWorkflowShape`, at `generation.rs:1110`. Neither side touched the other's lines, so the three-way merge was textually clean and the result did not compile: error[E0433]: cannot find type `TestWorkflowShape` in this scope --> crates/onnx-genai-engine/src/pipeline/generation.rs:1110:17 Renamed it with the rest. `cargo check -p onnx-genai-engine --features native-backend --all-targets` -> 0, `--test shape_dispatch_gate` -> 2 passed, `--lib` -> 481 passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- crates/onnx-genai-engine/src/pipeline/generation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/onnx-genai-engine/src/pipeline/generation.rs b/crates/onnx-genai-engine/src/pipeline/generation.rs index cccc94ae5b..05767e55de 100644 --- a/crates/onnx-genai-engine/src/pipeline/generation.rs +++ b/crates/onnx-genai-engine/src/pipeline/generation.rs @@ -1107,7 +1107,7 @@ fn test_decoder_runtime_inner(shape: TestSessionShape) -> anyhow::Result