Skip to content

server: share JSON values through a named module - #860

Merged
ashhart merged 1 commit into
ashhart:mainfrom
jayleaton:shared/json-module
Oct 16, 2026
Merged

ashhart merged 1 commit into
ashhart:mainfrom
jayleaton:shared/json-module

Conversation

@jayleaton

Copy link
Copy Markdown
Contributor

What this changes

Extract the named JSON module from #702 so the server and future family text adapters can share the same json.Value types without a DeepSeek dependency. All server consumers use the named import; the JSON implementation retains its internal file imports and exposes wtf8Encode through the public surface.

Illustrative module ownership:

server consumer -> @import("json") <- future family consumer
                         |
                 server/json.zig
                  /           \
            json_parse     json_write

zig/build/server.zig provides json and the family-neutral addTo helper. Both native server builds, host tests, Cortheon fuzzing and direct CPU harnesses receive the shared module; JSON's tests run separately. This branch is based directly on pinned main and does not depend on the shared lane extraction.

Receipt

  • Environment, with the TensorFold commit, MLX or PyTorch version, machine and GPU, checkpoint and revision: local Linux CPU host, Zig 0.17.0; candidate 29304163e0ab97d335cba9daaabc4ccb0ea6e7a7, pinned base c7137bb31a7dad924fb541a7068422127b9a94b2. No checkpoint, GPU, MLX or PyTorch used.
  • Exactness, from tools/bench_concurrent.py --alone --serial or token_sha against "draft": false: no device/model receipt; JSON parser/writer implementations are unchanged. Existing server tests and frozen HTTP goldens pass with the shared module.
  • Decode speed before and after, from tools/bench_openai.py: n/a; this changes module ownership, not decode arithmetic or scheduling.
  • Prompt speed before and after: n/a; this changes import wiring without changing prompt processing logic.
  • Tests run, with pass, fail and skip counts: final clean-head checks below. Some targets used Zig’s cache; counts describe this invocation, not a full-suite total. Direct same-engine-tree receipts from the original extraction: server 202/202, JSON 5/5, engine seam 110/110 passed. The earlier uncached extraction host receipt recorded 743 passed, 5 skipped; those skips remain explicit. The app-only base advance leaves all engine sources unchanged.
Gresume-shared-json: commit 29304163e0ab97d335cba9daaabc4ccb0ea6e7a7 tree 3d578c672051512cce64d155beb3d76cd73f0077 dirty 0 2026-10-15T01:06:49Z
install rc=0 Build Summary: 10/10 steps succeeded
test rc=0 Build Summary: 48/48 steps succeeded; 743/748 tests passed (5 skipped)
test-golden rc=0 Build Summary: 4/4 steps succeeded
fuzz-cortheon rc=0 Build Summary: 3/3 steps succeeded; 7/7 tests passed
test-cuda-host rc=0 Build Summary: 29/29 steps succeeded
test-server-cpu rc=0 Build Summary: 5/5 steps succeeded
zig fmt --check rc=0 0 files
git diff --check rc=0
29304163 lean: 527 problems, 527 on the base, 0 new
FAILED STEPS 0
  • Not run, and why: CUDA/Metal/model checks are not run for this host-only import extraction; host success does not qualify a device. zig/tests/server/build.sh compiled fake_serve, then its engine-less native build failed at main.zig:11 with no module named 'checkpoint_cli'. The same module graph on pinned main produces the identical error; the unrelated CLI wiring remains unchanged. This extra direct build check is incomplete, not a pass.
  • Before: main uses local-file JSON imports. After: server consumers use the named module; parser/writer source blobs are byte-identical to main. Both frozen HTTP goldens and the existing JSON/server suites pass.

Merge Danger — Door: two-way. Blast Radius: server. A revert restores local-file imports. Every independently constructed server module must now provide the named json import; repository build paths and CPU test harnesses are wired here. No persisted data or JSON wire-format change is introduced.

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.
  • No precision traded for speed. If the bits change, the description says which sums change and why.
  • Prompt processing is no slower than the last release.
  • The description says which platforms I ran, Metal M1 to M5 and CUDA, and which I could not.
  • 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.

Extract the family-neutral JSON module wiring from ashhart#702. Server files
import the shared module, whose own parser/writer tests run separately,
and build helpers and direct CPU harnesses provide the named import.
Expose wtf8Encode through that shared surface.

Ported from 4efa5725e030255d49a5bdd9893cd6b913ae0244.
No DeepSeek serving code, fixtures or backend dependencies are included.
@ashhart

ashhart commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Thanks, @jayleaton, for splitting this out as requested on #635. Ready at 2930416. The parser and writer are unchanged, the server callers share the named JSON module, and the current server roots and standalone test builds attach it. I found no new behavior or lifetime issue in the source review; builds and tests were not rerun here.

@ashhart
ashhart merged commit dbf2c65 into ashhart:main Oct 16, 2026
4 checks passed
ashhart added a commit that referenced this pull request Oct 16, 2026
…s named json module

#860 moved the server's JSON values into one named module from public main's tree. Files the candidate added since (the benchmark, Recall and imprint routes, saved conversations, pictures, System One, the /health test) still imported json.zig by path, and a file may not sit in two modules, so they import "json" now; systemone.zig wrote through json_write.zig directly and now uses the same functions json.zig re-exports. The server roots the candidate added (the HIP and XPU servers, and the Linux tool-parse tests) attach the module as the others do.
ashhart added a commit that referenced this pull request Oct 16, 2026
…g, tests/server/build.sh)

Layout only, by zig fmt after closing commas; the shell lines break between arguments.
ashhart added a commit that referenced this pull request Oct 16, 2026
@ashhart

ashhart commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Thank you, @jayleaton. Making the server's JSON values one named module is a clean step toward family code that serves its own routes.

Your commit ships in TensorFold 1.0.12 as it is, merged in dbf2c65ef, so this pull request shows as merged. The release had gained twenty server files since your base, still importing json.zig by path, and one file cannot sit in two modules, so our 4bf7a998b moves them to the named import and attaches the module to the HIP and XPU servers and the Linux tool-parse tests. 801dc5a03 wraps the new build lines. The golden suite's replies are unchanged, and no served reply changed.

Posted by Ash's AI Assistant Synthena

BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
prompt.zig keeps the candidate's engine_api import beside the head's named json import.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…rt#860's named json module

ashhart#860 moved the server's JSON values into one named module from public main's tree. Files the candidate added since (the benchmark, Recall and imprint routes, saved conversations, pictures, System One, the /health test) still imported json.zig by path, and a file may not sit in two modules, so they import "json" now; systemone.zig wrote through json_write.zig directly and now uses the same functions json.zig re-exports. The server roots the candidate added (the HIP and XPU servers, and the Linux tool-parse tests) attach the module as the others do.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…cuda.zig, tests/server/build.sh)

Layout only, by zig fmt after closing commas; the shell lines break between arguments.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 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