Repository navigation
Close Gemma tool-result turns in shared bundle export - #45
Conversation
|
SOURCE EVIDENCE: tested exporter head LIVE EVIDENCE (renderer execution, not model inference): actual 12B/E4B QAT JANG_4M templates rendered through the current Swift Jinja source and Python Jinja2 3.1.6: 192 renders, zero errors, 128/128 byte comparisons agree. Corrected tool-result→user boundaries close 32/32; old runtime surgery leaves 32/32 open. Controls vary history shape, thinking and generation-prompt switches. No model was loaded for these controls, so inference speed/coherence/cache acceptance is not claimed; no sampler was overridden. Current focused template-contract CI passes (41170232719). Broader run41170232733: 800 passes, 64 skips, one existing DSV4 cache offset128/2048 failure. Exact main base aa6106f run40565052036 has the same failure (785 passes,64 skips). No unrelated DSV change or gate waiver. This merges only the reproducible exporter source correction. Already-published bundles remain unchanged, and affected native model qualification is pending in runtime698/consumer3256. No bundle upload, tag, release or workflow retry is performed. Earlier unrelated acceptance remains retained. Local receipt identities:
|
Gemma exports retained an older tool-result closure branch: a following user turn could begin before the preceding model turn closed. Both affine JANG and MXFP exporters share the same sidecar path, so the correction lives there and keeps the file/embedded templates synchronized.
Backport the canonical Gemma next-non-tool continuation rule. Keep final tool-result turns open for pending generation and assistant continuation, and close them before a new user. Remove the exact instruction that older exports injected for required tool choice; tool-choice validation is not a reason to rewrite the conversation with an extra prompt. Preserve the existing no-thinking generation-prefill policy and generation-token metadata propagation.
The template transformation and metadata writer are now pure helpers, independent of MLX weight conversion. Fifteen focused tests pass, covering single/multiple results, thinking switches, assistant continuation/fragments, pending calls, terminal results, idempotence, legacy instruction removal and file/embedded consistency. Replacing only the transformation with its exact original production implementation yields nine assertion failures and no setup errors. CI runs these contracts on Linux without loading a model.
References: osaurus-ai/osaurus#3237; Google's canonical Gemma 4 template revision
43c9d014b231474fa7212dbb48a762566c2b255d. Current Hub templates of the two reported 12B MXFP variants match the locally inspected JANG variant and retain the old branch.Actual installed-template controls now pass: 192 renders without errors, 128 Swift/Python byte-identical comparisons, and 32/32 corrected tool-result→user closures. The old runtime rewrite leaves 32/32 open.
CI at
e252167b61b478548b029f5e541af307634b2ebd: the 15-case template contract and public-document check pass. The broader macOS run has 800 passes, 64 skips and the same single DSV4 cache offset failure present on exact main baseaa6106f8e6cb9c34831a0686e0287650beff1d5a(785 passes, 64 skips). Runs: 41170232719 / 41170232733 / baseline 40565052036. No unrelated DSV code or gates changed.Draft: affected native model proof remains pending. This PR does not by itself update already-published bundles or establish that the reported thought-channel repetition is caused/fixed by turn closure. No weights, quantization, sampler defaults, runtime template replacement, version tag or release workflow changes. Existing unrelated qualification is retained. No screenshots or private evidence attached.