Skip to content

server: capabilities --json's Engines struct moves to cli_capabilities.zig - #1375

Closed
BlivionIaG wants to merge 1 commit into
ashhart:mainfrom
BlivionIaG:series/capabilities-split
Closed

BlivionIaG wants to merge 1 commit into
ashhart:mainfrom
BlivionIaG:series/capabilities-split

Conversation

@BlivionIaG

@BlivionIaG BlivionIaG commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Branch: series/capabilities-split, one commit on main c0c7bd24f.

What this changes

cli_capabilities.zig already writes the capabilities document (main f3c1ab024).
The Engines struct it reads still sat in cli.zig.
This change moves the struct next to its writer. cli.zig re-exports it, so cli.Engines and cli.capabilities keep working for engines.zig, benchmark.zig, main.zig and cli_test.zig.
cli.zig goes from 598 to 589 lines, so the next serve flags fit under the 600-line limit.
No behaviour change.

Files: zig/src/server/cli.zig (+2 -11), zig/src/server/cli_capabilities.zig (+14 -2).

Receipt

  • Environment: TensorFold main c0c7bd24f and this branch 06a5236ce, Zig 0.17.0, -Dcpu=apple_m1 -Dversion=1.1.4, Apple M4 Pro, macOS (Darwin 25.5.0).
  • capabilities --json: built native from main and from the branch and ran tensorfold-native capabilities --json on each.
    The two outputs are byte-identical: cmp reports no difference, both are 6853 bytes, and both have SHA-256 cb09db79b76a6681514a9be60a2074d650607bd9cdb4cbb70499a306a2373467.
  • Exactness, decode speed, prompt speed: n/a. The change moves a type declaration; no request path changes.
  • Tests run on the branch:
    • zig build native -Dcpu=apple_m1 -Dversion=1.1.4: exit 0.
    • zig build test-server-cpu -Dcpu=apple_m1: exit 0, 792 of 795 tests passed, 3 skipped (the server test binary 787 pass, 3 skip of 790; a second test step 5 of 5). On main's Zig sources the server test binary gives the same 787 pass, 3 skip of 790 (its 5-test step was cached in that run).
    • zig build test-golden -Dcpu=apple_m1 on main's Zig sources: the same 322/335 and 26/26, 0 unexpected differences.
    • zig build test-golden -Dcpu=apple_m1: exit 0; 322/335 and 26/26 equal to server goldens, 0 unexpected differences (the 13 differences are the existing KNOWN-DIFFER entries).
    • zig fmt --check on both files: exit 0.
    • git diff --check c0c7bd24f: clean.
    • python3 tools/zig/lean_check.py: 433 problems on main and 433 on the branch, the same findings line for line. The baseline findings are inherited; this change adds none.
  • Not run, and why: the full zig build test, test-kernel-contract, fuzz-cortheon, the Linux CUDA host build and HIP. The change touches two server files that every platform compiles the same way; CI's Linux build will cover the non-macOS compile.

Tests

No new test. A moved declaration has no failing case to show.
The existing cli_test.zig capabilities tests call cli.capabilities with cli.Engines values, so they compile and pass through the re-export (part of the 787 above).
The byte comparison of the real binary's output is the check that the document did not change.

Not measured

  • No model was loaded; no performance claim is made.
  • M1, M2, M3, M5 and CUDA/HIP machines were not used.

Related PRs

Prerequisite for the DSpark drafter's two serve flags: #1392 sits on this PR. Part of #1374.

Issue

CONTRIBUTING asks for an issue first only for a new model family, backend or arithmetic change. This is none of those, so no issue is needed.

Prerequisite for the DSpark drafter's two serve flags (#1374): they need room in cli.zig.

…s.zig

cli_capabilities.zig writes the capabilities document, but the Engines
struct it reads still sat in cli.zig, which is 598 lines. The struct
moves next to its writer and cli.zig re-exports it, so callers do not
change. cli.zig drops to 589 lines.

capabilities --json prints the same bytes as on main.
@ashhart

ashhart commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Landed on main (2a37b63), thanks @BlivionIaG: a pure move, cli.zig back under 600 lines with room to spare; server CPU tests pass.

@ashhart ashhart closed this Oct 26, 2026
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