Repository navigation
Sweep 1565 high-risk: extraction marker read failures and .tmp cleanup, Firefunction v2 call id, DeepSeek R1 buildGrammar pin, x86_64 iOS simulator label - #1584
Merged
Conversation
…p, Firefunction v2 call id, DeepSeek R1 buildGrammar pin, x86_64 iOS simulator label - An archive or extraction the hook cannot read fails the marker check instead of matching (kills W1), and a marker write or rename that fails deletes its .tmp. - Firefunction v2's tool-call grammar no longer requires a free-text `id`; llama.cpp's grammar declares only `name` and `arguments`. - Pin that DeepseekR1Handler.buildGrammar() returns the parallel-call grammar, like the other context-free handler grammars (kills M7). - Image runtime reasons label the x86_64 iOS simulator `ios-x64-sim`, the hook's stable_diffusion bundle key, and default-wiring and iosX64 cases kill M5, M2 and M6. Refs #1565
leehack
marked this pull request as ready for review
October 29, 2026 05:25
This was referenced Oct 29, 2026
Contributor
|
Chat app preview removed for |
Merged
13 tasks done
leehack
added a commit
that referenced
this pull request
Oct 30, 2026
….5 structured parse (#1605) Marker: a failed write removes its .tmp and rethrows the original error, even when the cleanup itself fails (#1584 audit A3, A5, A8). The not-published list names the hook's stable_diffusion bundles (A9). Genkit: Qwen3.5 with thinking off keeps a thought in the content, as the migration guide says.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clears the open high-risk items from the 0.17.0 follow-ups tracker #1565:
FileSystemException. It no longer matches, which kills W1 (the catch widened to the whole check). When a marker write or rename fails, the.tmpis now deleted best-effort before the error is rethrown.idstring. This mirrors the LFM2 fix in Match llama.cpp tool-call grammars for DeepSeek R1, LFM2 and Functionary v3.2 #1578 (b0c8e14b4). Upstream leavesidundeclared in both places: the legacycommon_chat_params_init_firefunction_v2(566059a26^) listsidunderrequiredbut not underproperties, and at620d2225cthe autoparser builds the grammar from the template, which renders calls as{"name": ..., "arguments": ...}. The parser still reads anidif the model writes one.DeepseekR1Handler.buildGrammar()(mutant M7 from the Match llama.cpp tool-call grammars for DeepSeek R1, LFM2 and Functionary v3.2 #1578 audit): the default is kept (paralleltrue) and now pinned by a test. The method is public through the exportedChatTemplateEngine.handlerFor(...). The other context-freebuildGrammaroverrides (Firefunction v2, Functionary v3.1/v3.2, EXAONE MoE) also return the parallel-call grammar, so tightening only DeepSeek R1 would silently change a public method's output and make it inconsistent with its siblings. Nothing in production calls it:renderpasses the request's parallel flag.ios-x64-sim, the hook's stable_diffusion bundle key (stableDiffusionBundleForNativeBundle), instead ofios-x64. New cases cover the default wiring (Abi.iosArm64, noisIosSimulator, non-simulator host givesios-arm64) andAbi.iosX64withisIosSimulator: () => true. A cross-check asserts that each iOS label equals the hook's bundle key. These kill M5, M2 and M6.Production-readiness scope
ToolChoice.requiredon Firefunction v2 constrains the model tonameandargumentsonly. Image runtime reasons on the x86_64 iOS simulator nameios-x64-sim. A failed marker rewrite leaves no.tmpbehind.FileSystemException, now pinned by a test.Completeness checklist
PR type guidance
idKey: 'id'added a required, unbounded"id"string that llama.cpp never declares. The x86_64 simulator label came fromAbi.toString()rather than the hook bundle key. The other items are test pins and best-effort cleanup.Test Plan
dart run tool/prepare_workspace.dart(clean tree after)dart format --output=none --set-exit-if-changed .dart analyzedart run tool/testing/check_platform_boundaries.dartdart test -p vm -j 1 --exclude-tags local-only: +9814 ~8, all passed (withREQUIRE_LLAMA_CPP_TEMPLATES=1, isolatedTMPDIR)dart test -p chrome --exclude-tags local-only: +4117 ~1, all passedtool/testing/run_template_parity_suites.shwithtest-gbnf-validatorbuilt at llama.cpp620d2225c(the shipped runtime): detection +74, diagnostics +93, unit template +1624, upstream parser +10, compiled grammar +61--run-skippedspecialized_tool_grammar_validation_e2e_test.dart+required_tool_emissions_test.dart: +67test/unit/hook,test/unit/backends/stable_diffusion,test/unit/core/template,test/integration/core/template: +2616test/unit/tooling: +1240 ~5Matrix Evidence
structured-output-adversarialbuildGrammartest-gbnf-validator@620d2225cfunctools[{"name": ..., "arguments": ...}]from llama.cpptests/test-chat.cpp, which matches what the vendored template renders, and the durable fixturetest/fixtures/llama_cpp_templates/fireworks-ai-llama-3-firefunction-v2.jinja. Base grammar rejects the upstream form and accepts"id"; head accepts the upstream form and rejects"id"(llamadart-evidence/sweep-1565-hr2/validator-probes.txt)template-parityrun_template_parity_suites.shas abovehigh-risk-exact-head-independent-qa/opt/UnitySrc/personal/llama/llamadart-evidence/pr-1584/evidence-1584-6b6711f.jsonios-simulator-smokeunavailableReason). It is covered by the injected-ABI unit tests and by the cross-check againststableDiffusionBundleForNativeBundle. No bundle or staging changeMutants, each applied alone and run against its suites (
llamadart-evidence/sweep-1565-hr2/mut_*.log):.tmpnot deletedidKey: 'id'restored (unit + e2e; e2e alone also kills it)DeepseekR1Handler.buildGrammarparallelfalseisIosSimulatoralways true-simlabel applied toAbi.iosX64Abi.iosX64labelled by ABI (ios-x64, the pre-fix behaviour)Review Notes
High-risk regression review
tests/test-chat.cppat620d2225c), the legacy upstream grammar source (566059a26^:common/chat.cpp) and the vendored template fixture, compiled withtest-gbnf-validatorat620d2225c.