Skip to content

lanes: the shared price log covers the shared-drafts grant path - #4686

Merged
ashhart merged 3 commits into
ashhart:mainfrom
eXsoR65:price-log-shared-path
Nov 23, 2026
Merged

ashhart merged 3 commits into
ashhart:mainfrom
eXsoR65:price-log-shared-path

Conversation

@eXsoR65

@eXsoR65 eXsoR65 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

What this changes

TF_SHARED_PRICE_LOG=1 logs a priced shared round only on the plain-guard path; the shared-drafts grant path (allocate_shared_drafts, plain_guard=false) stays silent, so its per-depth accept= estimates cannot be read — the gap noted in #3606. This moves the head_ms computation and the price_log.round call out of the if (independent) branch in shared_round.zig so a timed shared-drafts round logs the same line. observeSharedPrice stays inside the gate (and is itself gated by plain_guard), so pricing is unchanged: log only.

  • Issue: Refs App-launched engine picks min_rows 1 (vs 8 standalone) — ~10 tok/s vs ~60 tok/s on M1 Max #3606 (the price-log coverage sub-task the maintainer asked for; the grant-efficiency decision and the title overlap remain open).
  • Stacked on: main (833d8ec46562a4f34d4d81fc1b945a55aba51009).
  • atc overlap --json: against main 833d8ec46, 2026-11-22 — changedFiles: 2, overlaps: [], no conflicts reported. Coverage is incomplete (pullFilesUnavailable, otherPullRequestsLimit, timeLimit), so this is best-effort; atc who zig/src/core/lanes/shared_round.zig --json likewise showed no overlapping edits.

Checks on this head

  • Head commit: 91b66182760b0e14ba8e1bb513fc9267ad25a5b0
  • Lean checker, python3 tools/zig/lean_check.py, on the base and on this head: base 833d8ec46 = 165 problems, head = 165 problems; lean_new.py reports 0 new (the 165 are inherited; this change adds no getenv and the test file is not counted).
  • Tests run, with the command and pass, fail and skip counts: the lanes host test root (zig/src/core/lanes/lanes.zig, unfiltered) on Linux x86_64 / Zig 0.17.0 — 451 passed, 1 skipped, 0 failed (452 total), including the two new price_log_test.zig cases; the three pre-existing price-log cases still pass. Falsification: with the hoist reverted, the engine-driven case fails at the price_log assertion (450/452, 1 failed), so it guards the regression. zig fmt --check build.zig zig and git diff --check: clean. Diff is exactly shared_round.zig (+5/−2) and price_log_test.zig (+59); both files ≤600 lines, comments one line ≤120 cols.
  • CI: not yet run on this head (just opened); the no-GPU host shards are the relevant gate and run on the PR. Any failure will be classified introduced vs inherited.
  • Not run, and why: the full zig build test test-golden aggregate and the GPU/kernel-contract gates were not run locally (no GPU on this VM; disk-constrained). CI runs the full host shards. The change is log-only in core lanes (default off) and touches no kernel, backend, config or arithmetic; price_log.zig is untouched.

Receipt

n/a — log-only diagnostic coverage. TF_SHARED_PRICE_LOG defaults off: with it unset nothing changes, and with it set the change only emits a log line (pricedHeadMs is pure over *const Rule; price_log.round/line write a line; enabled reads the env once and caches it). No rule mutation, pricing or token change on either path, so it cannot alter inference output and the inference checklist is skipped; the host checks are under "Checks on this head". The M4 Pro per-depth accept= reading and the #4628/#4629 before/after drafter arms follow separately as discussed in #3606.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency (the new cases use a fake drafter and have no absent dependency).
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.

@eXsoR65

eXsoR65 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Transparency: this PR was prepared by eXsoR65's AI agent (DeepSeek Harness), authorized and reviewed by eXsoR65 before posting. It implements the log-only shape @ashhart described in #3606 — head_ms and price_log.round hoisted out of the plain-guard branch, observeSharedPrice still gated, pricing and tokens unchanged. The host checks and the fail-before/pass-after guard in the description were run on a Linux x86_64 VM (no GPU); CI runs the full shards here. The M4 Pro per-depth accept= reading and the #4628/#4629 before/after arms follow separately.

— eXsoR65's AI agent (DeepSeek Harness)

ashhart and others added 3 commits November 23, 2026 19:05
Move head_ms and price_log.round out of the plain-guard branch so the log records both grant paths; observeSharedPrice stays gated. Log only, pricing unchanged. Refs ashhart#3606.
@ashhart
ashhart force-pushed the price-log-shared-path branch from 91b6618 to d580abb Compare November 23, 2026 19:06
@ashhart
ashhart merged commit 03816aa into ashhart:main Nov 23, 2026
2 of 12 checks passed
@ashhart

ashhart commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thank you @eXsoR65. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

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