Repository navigation
Tests: the server's linear-time checks compare the thread's cycles on Windows - #1854
Merged
Merged
Conversation
9 tasks done
9 tasks done
… Windows 04f2420 put these checks on the thread's CPU clock where std has one and left Windows on the awake clock, so tests running beside them can still slow only the larger size. `fastest` now also returns each size's `work`: the thread's cycles from QueryThreadCycleTime on Windows, the ns it already took elsewhere. The checks compare `work` between sizes. Their limits in time stay on `ns`, since cycles are not time.
ashhart
force-pushed
the
pr/linear-time-cycles
branch
from
November 2, 2026 05:30
b950f2e to
d0fadd9
Compare
Owner
|
Thank you @Bizuayeu. 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. |
Owner
|
Thanks @Bizuayeu! This is in TensorFold 1.2.2, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.2 |
9 tasks done
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.
What this changes
linear_time.fastestnow also returns each size'swork: the thread's cycles fromQueryThreadCycleTimeon Windows, the ns it already took elsewhere. The checks compareworkbetween sizes. Their limits in time (20 ms, 5 s) stay onns, since cycles are not time.04f2420d8(#1482) put these checks on the thread's CPU clock where std has one and left Windows on the awake clock, becauseClock.cpu_thread.resolutiongivesClockUnavailablethere. So a busy runner can still slow only the larger size.zig-windowsfailed this way three times in about 600No GPUruns over the two days to 11-01, on branches that do not touch the server (pr/glm-l2pf,lfm3-xpu,dsv41-up/dspark-statics). Each time it was another reader and page, and the job's only failure.Receipt
mainat9e8c368b0, Zig 0.17.0. Windows 11 natively, eight cores. Linux x86_64 under WSL2. Host tests only, no GPU.Reproduction on Windows: the Debug build of
cortheon fuzz: every reader takes linear time on long inputs,mainand this head in turn, beside busy processes:mainfailedclean7 ms → 233 ms)The same rounds on both counts, 959 reader and page pairs of three rounds with 8 busy processes: 48 over the line on the awake clock (up to 375x), 0 on cycles (7.6x at the median, 9.8x at most).
Mutations: with
workset tons, the new test fails on Windows. With atoTextthat searches back to the page start for every mark, the linear-time check fails on 9 pairs (9 ms → 619 ms).Windows:
zig build test --test-timeout 10m421/421 steps,zig build fuzz-cortheon3/3 steps (19/19 tests).Linux:
zig build test458/458 steps (6,111 of 6,140 tests, 29 skipped),test-cuda-host278/278 steps,test-server-security test-pull-security14/14 steps,fuzz-cortheon3/3 steps (19/19 tests).zig fmt --checkclean.tools/zig/lean_check.py: 424 problems onmainand on this branch, zero new.workis thensit already took. A GitHub runner under load: time the host takes from a VM's CPU may still count in cycles, and I could not measure that here. CUDA and Metal device checks do not apply.On the same rounds, 12 more rounds after a miss left 21 of the 48 pairs over the line, and a floor of 100 ms left 2, so neither was the fix. The check in
tool_parse_test.zigthat readsclockitself stays on the awake clock; it allows 64x for 32x the calls and did not fail in these runs.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Test-only change.)SUMMARYline is in the receipt. (No kernel changes.)fastest's work leaves out a sleep in a runfails on Windows withworkset tons, and skips where there is no CPU clock.)