Repository navigation
Tests: pins for the documented limits, defaults and flag dependencies, a replay of the prompt cache's eviction, and a timing of its index - #2305
Merged
Conversation
4 tasks done
ashhart
added a commit
that referenced
this pull request
Nov 6, 2026
ashhart
force-pushed
the
lead/tests-1106
branch
from
November 6, 2026 12:13
bacf935 to
eea7b6c
Compare
This was referenced Nov 9, 2026
ashhart
added a commit
that referenced
this pull request
Nov 9, 2026
…the backend gate GLM's env_defaults_test module takes core and canon beside cuda and heat, as main's GLM CUDA module has them: Settings.read now reaches cuda_l2pf.zig and the weight, format and shard files that import them. Drama's two settings read through the environment table since #2658, so a word in TF_DRAMA_PREFILL_ROWS is refused with the table's text, which the pin now expects; a new pin covers TF_DRAMA_REFERENCE_CACHE's default and its refusal past 16, and the table cases add the values only drama_open bounds. The flag-deps pin parsed --backend mlx everywhere, but off macOS a test root's build serves auto and cuda (cli.zig backend_values), so it failed on Linux; it now takes each build's own backend and refuses the other.
ashhart
force-pushed
the
lead/tests-1106
branch
from
November 9, 2026 08:00
e643398 to
2fb9170
Compare
Add test-cache-index-timing, a host-only ReleaseFast step that fills the store with interleaved chat conversations of 2K to 64K tokens (shared system prompts, forks and unrelated prompts) and times find for a next-turn hit, an edited-prefix hit, a miss and a hit on the longest state, warm and cold, plus the whole lookup. Each query is checked against the whole-store oracle before it is timed, so the index can be re-measured before any change to it.
drama_cfg.zig serves --cfg-gamma, --cfg-batched and --cfg-force-guided natively only on macOS, so Linux and Windows refuse them as not served and the pins failed there.
…the backend gate GLM's env_defaults_test module takes core and canon beside cuda and heat, as main's GLM CUDA module has them: Settings.read now reaches cuda_l2pf.zig and the weight, format and shard files that import them. Drama's two settings read through the environment table since #2658, so a word in TF_DRAMA_PREFILL_ROWS is refused with the table's text, which the pin now expects; a new pin covers TF_DRAMA_REFERENCE_CACHE's default and its refusal past 16, and the table cases add the values only drama_open bounds. The flag-deps pin parsed --backend mlx everywhere, but off macOS a test root's build serves auto and cuda (cli.zig backend_values), so it failed on Linux; it now takes each build's own backend and refuses the other.
ashhart
force-pushed
the
lead/tests-1106
branch
from
November 9, 2026 10:48
2fb9170 to
e9fcee5
Compare
ashhart
added a commit
that referenced
this pull request
Nov 9, 2026
…the backend gate GLM's env_defaults_test module takes core and canon beside cuda and heat, as main's GLM CUDA module has them: Settings.read now reaches cuda_l2pf.zig and the weight, format and shard files that import them. Drama's two settings read through the environment table since #2658, so a word in TF_DRAMA_PREFILL_ROWS is refused with the table's text, which the pin now expects; a new pin covers TF_DRAMA_REFERENCE_CACHE's default and its refusal past 16, and the table cases add the values only drama_open bounds. The flag-deps pin parsed --backend mlx everywhere, but off macOS a test root's build serves auto and cuda (cli.zig backend_values), so it failed on Linux; it now takes each build's own backend and refuses the other.
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.
Two test-only additions. No production code changes.
Pins for the documented limits (
zig/src/server/limit_pins_test.zig,zig build test-limit-pins-host): for each limit thatdocs/api.mdor the README states with no existing test, one case at the bound that's accepted and one just outside that's refused, with the refusal text the server answers. The limits are the penalties' -2 to 2,min_p's 0 to 1,top_logprobs' 0 to 20 (and only withlogprobs),nof 1, the Responsesmetadatacaps (16 pairs, keys up to 64 characters, values up to 512),--max-frames1 to 8,190, and--reasoning-effort's six levels. Limits that already had a test are cited in the test, not duplicated. A doc and the server can no longer drift apart on these without a red test.Pins for the documented
TF_*defaults (zig build test-env-defaults-host, in its ownzig/build/env_defaults.zig): unset gives the documented default, a value in range is taken, and one just outside is refused or clamped as the code does today, forTF_DRAMA_PREFILL_ROWS,TF_LOAD_PREFETCH,TF_GLM_PREFILL_REDUCE,TF_GLM_PROMPT_K,TF_GLM_DENSE_BITS,TF_GLM_CLEAR_THINKING,TF_KV_PAGESandTF_QWEN27_COPIESwhere no test already did.Pins for the flag dependencies (
zig/src/server/flag_deps_test.zig,zig build test-flag-deps-host): a flag that needs another, such as--cfg-batchedand--cfg-force-guidedneeding a gamma switch, and the backend build gates, each with its refusal text and its accepted form. Dependencies that already had a test are left to those tests.A replay of the prompt cache's eviction (
zig/cache_replay*.zig,zig build test-cache-replay-host, andzig build cache-replayto rerun it):Store.beginandStore.keep, including main's victim choice, with three agent-shaped traces: long coding sessions that grow turn by turn, one-off requests between them, and a session that goes idle and returns. It uses the 27B's real state sizes and a 2,000 tok/s recompute cost.A timing of the prompt cache's snapshot index (
zig/src/core/prompt_cache_index_timing_test.zig,zig build test-cache-index-timing, ReleaseFast, host only, not part of the default test run). It times the index at 16 to 1,024 kept states. The costliest lookup at 1,024 states takes 9 µs with warm caches and 39 µs cold, about 1/128,000 of a 5 s prompt pass. So a prefix hash isn't worth building: hashing a 64K-token prompt costs about as much as the whole scan.Checks:
zig build test-limit-pins-host test-cache-replay-host compile-cache-replay-host test-prompt-cache-host: 12 of 12 steps, 536 of 536 tests;test-cache-index-timing3 of 3 steps, 11 of 11 tests;test-env-defaults-host test-capability-env-host test-flag-deps-host test-limit-pins-host15 of 15 steps, 99 tests passed and 2 skipped.zig fmt --check, no new lean finding, and a plainzig build(255 of 255 steps).