Skip to content

server: /v1/systemone, llama-server's System One request, through an engine decide hook - #843

Merged
ashhart merged 2 commits into
ashhart:mainfrom
plotarmordev:feat/server-systemone
Oct 16, 2026
Merged

ashhart merged 2 commits into
ashhart:mainfrom
plotarmordev:feat/server-systemone

Conversation

@plotarmordev

@plotarmordev plotarmordev commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

POST /v1/systemone: llama-server's System One request (a state as text, JSON or a chat; questions keyed by id of type noul, choice or score; pictures as data URLs in files, images or a chat state's image_url parts, at most 4), answered with probabilities and zero output tokens. Each question is rendered as d1's systemone chat template renders it, read at its single-token option forms (an option scores its best form), and answered with a softmax over its options. Malformed requests are refused with llama-server's sentences.

The engine API gains what this needs, and nothing else uses yet:

  • Engine.decide(*Decision): one pass over a shared trunk (pictures expand at at) and a branch a question, each branch's label logits at its last row; Decision.read reports the trunk's tokens with its pictures expanded, and Decision.problem an engine's refusal.
  • score takes a mass flag: /v1/decisions asks for the vocabulary's logsumexp, System One does not, so an engine can skip the full head.
  • Info.decides (the engine writes no text: chat and completions are refused with "this model makes decisions and does not write text: use POST /v1/systemone") and Info.pictures.

An engine without score or decide serves no /v1/systemone path (404, as an unknown path). The third pull request in this series (#844) adds the engine that implements these (d1-3B on CUDA).

The d1 recipe these pull requests port (container build, checkpoint checksums, benchmarks) is github.com/plotarmordev/d1-tensorfold; that repository goes public within the next 24 hours, until then the link does not resolve. The whole series was tested end to end on a GB10 against Transformers' bf16 answers and the recipe's Python engine; #844 carries the receipts.

Receipt

  • Environment: TensorFold main (2962468f), Zig 0.17.0, aarch64 Linux (DGX Spark, GB10).
  • Exactness: systemone_test.zig checks six System One requests (noul with and without criteria, choices by letter and by name with JSON and empty descriptions, a 27-option choice that needs the code pool, scores, string / JSON / chat / numeric / null states) against prompts and answers reproduced from the d1 recipe's Python reference (github.com/plotarmordev/d1-tensorfold) with the same fake tokenizer and head logits: prompts byte-equal, answers equal (floats to 1e-12), through decide and through score alike. It also checks 14 refusals word for word, the picture order and the state's image parts taken out of its text, and the four-picture limit. With the d1 engine (third pull request) on a GB10, the recipe's parity set's answers match the Python reference's on all 99 questions.
  • Decode speed before and after: n/a, no decode path changes.
  • Prompt speed before and after: n/a, no prompt pass changes.
  • Tests run: zig build test 46/46 steps, 746/751 passed (5 skipped); server tests 210/210 and 110/110; zig build test-golden 309/319 equal to the frozen answers, 0 unexpected differences; zig fmt --check; lean_check as on main.
  • Not run, and why: Metal (server-side only; no engine implements the hooks until the third pull request).

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off. (Text generation is untouched; decisions write no tokens.)
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Unchanged for text.)
  • No precision traded for speed.
  • Prompt processing is no slower than the last release.
  • The description says which platforms I ran: host tests on aarch64 Linux.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

@ashhart
ashhart merged commit ecc99dd into ashhart:main Oct 16, 2026
4 checks passed
ashhart added a commit that referenced this pull request Oct 16, 2026
ashhart added a commit that referenced this pull request Oct 16, 2026
#626's three loader commits are in both histories as the same patches. The tree keeps the HIP series' qwen3_5/weights files and zig/build/hip.zig (one coreModule), drops qwen3_5/weights/experts.zig (core/quant stacks the experts now), and puts #626's CHANGELOG line before #631's.
ashhart added a commit that referenced this pull request Oct 16, 2026
Qwen3.5, Qwen3.6 and Flash Next on AMD GPUs through the opt-in HIP build (#617, #621, #626, #631, #697, #655,
#811-#818), bracket classes in the tokenizer (#842), System One requests (#843), the shared norm's loads (#796) and
d1-3B on CUDA (#844). CHANGELOG keeps every Unreleased line from both sides, this side's first. The kernel contract's
tf_rms_rows_bf16 record takes #796's values on sm_86, sm_89, sm_120 and sm_121; its sm_80 slot (from #846) takes the 32
static bytes #796 leaves, with the 79 registers sm_80 had.
@ashhart

ashhart commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Thank you, @plotarmordev. One hook that an engine can answer in a single pass, with nothing changing for engines that don't, is a clean way to bring System One in.

Both commits ship in TensorFold 1.0.12 under your name, 984ae4a98 (the route and the decide hook) and 22259b52e (the fake engine's mass flag), with a thank-you added to your CHANGELOG line (6728a6fb1). Your head is merged after them with no change to the tree (ecc99dda6), so this pull request shows as merged.

The server tests pass on macOS and Linux, and the golden suite's 319 replies are as before (309 equal to the frozen answers, the same 10 known differences). No engine before d1-3B scores or decides, so on every other model /v1/systemone answers 404 as an unknown path does and chat requests are untouched. Nemotron on a GB10 gave the same tokens with it in the build.

Posted by Ash's AI Assistant Synthena

BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
The contributor's two commits landed above with the same code; this keeps the PR's head in the history with no change to the tree.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
 with the HIP series

ashhart#626's three loader commits are in both histories as the same patches. The tree keeps the HIP series' qwen3_5/weights files and zig/build/hip.zig (one coreModule), drops qwen3_5/weights/experts.zig (core/quant stacks the experts now), and puts ashhart#626's CHANGELOG line before ashhart#631's.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…rt#844 onto the candidate

Qwen3.5, Qwen3.6 and Flash Next on AMD GPUs through the opt-in HIP build (ashhart#617, ashhart#621, ashhart#626, ashhart#631, ashhart#697, ashhart#655,
ashhart#811-ashhart#818), bracket classes in the tokenizer (ashhart#842), System One requests (ashhart#843), the shared norm's loads (ashhart#796) and
d1-3B on CUDA (ashhart#844). CHANGELOG keeps every Unreleased line from both sides, this side's first. The kernel contract's
tf_rms_rows_bf16 record takes ashhart#796's values on sm_86, sm_89, sm_120 and sm_121; its sm_80 slot (from ashhart#846) takes the 32
static bytes ashhart#796 leaves, with the 79 registers sm_80 had.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants