Skip to content

perf: scale chainSample's budget down at chunk size - #37

Merged
ahrav merged 4 commits into
masterfrom
perf/34-chunk-scale-chain-sampling
Jul 16, 2026
Merged

perf: scale chainSample's budget down at chunk size#37
ahrav merged 4 commits into
masterfrom
perf/34-chunk-scale-chain-sampling

Conversation

@ahrav

@ahrav ahrav commented Jul 14, 2026

Copy link
Copy Markdown
Owner

chainSample's routing vote pays a fixed budget — four 1KB windows, each walking up to 256 chain bytes of dependent failTrans16 loads — regardless of input size. At chunk scale that budget is mis-sized twice over: four windows cover a third of a 12KB parallel chunk (8x the sampling fraction the same code applies to a whole 96KB input), and on a dense-verdict parallel dispatch every worker walks it concurrently before scanning, where the sample's dependent loads run ~5x slower under 8-way LLC contention than solo (~4.9us → ~27us for 8 workers) — about 17us of the dispatch's critical path at 96–127KB.

Inputs under chainSampleSmallMax (parallelSparseMin/8 = 16KB, the largest chunk a gate-sampled dispatch hands a worker) now sample two windows (1/4, 3/4 points) under halved per-window caps. The cap ratio is preserved (128/12 = 256/24), so the byte cap still cuts a window off at the same mean excursion length relative to dualChainLongMin and the short bar keeps dualChainShortMax — only the evidence budget shrinks, not the vote's calibration. Whole inputs and ≥16KB chunks keep the full budget.

Alternatives measured and rejected: forcing one global density verdict onto all chunks captures more (-6.7% at 96KB) but mis-routes shallow-chain dense input +57% (density says dense, chains die at depth 1, single-cursor wins 1.4x — the chunk-local chain vote is what catches this); computing the vote once at the gate is a critical-path no-op (workers sample concurrently, so wall time is spawn + sample + scan either way); a sound early-exit inside the walk does not exist (the long vote is non-monotone in the walk state, and certainty bounds land beyond the caps).

TestRoutingPreserved pins the dual-vs-single verdict per corpus shape on both sides of the budget threshold, so a future budget change that flips a scan family's routing fails a test rather than a benchmark.

Measured (Graviton3, n=12 interleaved executions vs the stack tip): dense concat words -3.9% at 96KB, -2.8% at 127KB; sequential 12KB dense -7.5%; separator corpora at the density gate's edge -5.3/-5.6%; shallow-chain (false-start) input flat-to-better with routing preserved; sparse, hetero, and ≥16KB-chunk controls unchanged. chainSample itself: -73% at 12KB, exactly 0 at 16KB+. One noisy row (ibsen-48k, ±2% cv) reports +4.3% on a code path byte-identical in both arms; across five earlier same-code binary pairs it swung ±1.7–4.1% both directions — binary-layout artifact, not mechanism.

Follow-up to #32's sampling-guarantee discussion (the deferred half of the per-chunk re-sampling question). Stacked on #36.

This reduces chainSample’s work for inputs smaller than 16 KB while preserving routing decisions. Small inputs now use two sampling windows with halved per-window limits; full-sized inputs and chunks retain the existing sampling budget.

Why it was needed

chainSample runs during routing decisions for parallel dispatch. Its fixed sampling budget added unnecessary concurrent-sampling overhead for small inputs, especially in dense-verdict workloads. The change targets that cost without changing the cap ratio or shallow-chain routing behavior.

How it works

  • Inputs below chainSampleSmallMax (16 KB) sample windows near the quarter and three-quarter positions.
  • Each window uses half the previous step and excursion caps.
  • Larger inputs continue using the existing four-window, full-cap sampling layout.
  • chainWalk now receives explicit limits and stops when either the step or excursion cap is reached.
  • TestRoutingPreserved compares dual- versus single-cursor routing across the budget boundary using wordlike and falsestart corpora.
  • New benchmarks cover dense, heterogeneous, sparse, large-input, gray-zone, false-start, sequential, and direct chainSample costs. Runtime-regime assertions use runtime.GOMAXPROCS to validate that measurements exercise the intended dispatch paths.
flowchart LR
    A[Input size] -->|below 16 KB| B[Reduced chainSample]
    A -->|16 KB or larger| C[Full chainSample]
    B -->|two windows, halved caps| D[chainWalk]
    C -->|four windows, full caps| D
    D -->|chain/excursion evidence| E[dualWorthwhile routing verdict]

    classDef changed fill:`#fff4cc`,stroke:`#d4a017`,stroke-width:2px
    class B,C,D,E changed
Loading

Key decisions

  • The reduced layout keeps quarter/three-quarter sampling positions and preserves the cap ratio rather than simply sampling less at the same positions.
  • Whole inputs and chunks at or above 16 KB remain unchanged, limiting behavioral risk to the intended small-input regime.
  • Gray-zone benchmark results are logged as characterization data instead of being treated as strict pass/fail expectations.

Review focus

  • Verify the small-input threshold and window positions preserve routing calibration.
  • Check that both chainWalk limits are enforced consistently and that larger inputs retain the previous budget.
  • Confirm benchmarks assert the intended runtime regime rather than producing misleading measurements.

Files

File Change
trie.go Adds reduced-budget sampling for small inputs and configurable chainWalk limits.
routingpreserve_test.go Adds routing-preservation coverage across input sizes and corpus shapes.
samplepolicy_bench_test.go Adds sampling and dispatch benchmarks with regime validation.
dualscan_test.go Generalizes the trie fixture helper to accept testing.TB.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 67853101-aed6-4bf3-a834-7f614d12b7f8

📥 Commits

Reviewing files that changed from the base of the PR and between 0de9278 and fa4a0a9.

📒 Files selected for processing (2)
  • samplepolicy_bench_test.go
  • trie.go
📝 Walkthrough

Walkthrough

The change reduces chain-sampling budgets for small inputs, parameterizes chain-walk limits, adds routing-preservation coverage, and introduces benchmarks for sampling and dispatch regimes.

Changes

Routing Sampling

Layer / File(s) Summary
Parameterized chain sampling budget
trie.go
Small inputs use fewer sampling windows and lower step/excursion caps; chainWalk receives and enforces those limits.
Routing preservation tests
dualscan_test.go, routingpreserve_test.go
Test trie construction accepts testing.TB, and routing verdicts are checked across corpus shapes and input sizes.
Sampling policy benchmarks
samplepolicy_bench_test.go
Benchmarks cover dense, sparse, heterogeneous, false-start, gray-zone, control, density-check, and chain-sampling cases.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Poem

I hop through windows, two or four,
With capped excursions, never more.
The trie now tests each routing trail,
While benchmarks chase the fastest grail.
Squeak! Small inputs get care.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: reducing chainSample’s budget for smaller chunks to improve performance.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32b404f7f6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread trie.go
Comment thread samplepolicy_bench_test.go Outdated
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown

Greptile Summary

This PR scales chainSample's evidence budget down for inputs under 16 KB (the largest chunk a gate-sampled parallel dispatch hands a worker): two windows instead of four, each with halved per-window step and excursion caps. The ratio between the two caps is preserved so the effective threshold for the long/short vote (mean excursion length \u2248 25.6 bytes) is identical in both paths. A new tripwire test (TestRoutingPreserved) pins the dual-vs-single verdict for key corpus shapes on both sides of the budget threshold, and a new benchmark file covers the full dispatch matrix.

  • trie.go: chainSampleSmallMax constant added; chainSample branches on n < chainSampleSmallMax to a 2-window/128-step/12-excursion path; chainWalk now accepts maxSteps/maxExc as parameters instead of referencing the constants directly.
  • routingpreserve_test.go: New test asserting routing verdicts (dual/single) for word-like, false-start, and natural-text corpora at sizes spanning the budget threshold; separator-broken gray-zone corpora are logged rather than asserted.
  • samplepolicy_bench_test.go: New benchmark matrix covering the gate-sampled dense band, heterogeneous inputs, false-start routing, gray-zone separators, and the raw cost of chainSample and looksDense.

Confidence Score: 4/5

Safe to merge; the routing logic change is correct and well-tested, with no path that silently mis-routes a scan family.

The core bifurcation in chainSample is mathematically sound and TestRoutingPreserved pins the expected verdicts on both sides of the budget boundary. Two non-blocking issues exist: a comment inaccuracy about which chunks take the reduced budget (ceiling division at the band ceiling produces 16 384-byte chunks that slip through), and a missing length guard in the new test that would panic rather than fail gracefully if Ibsen.txt were replaced with a shorter file.

The chainSampleSmallMax comment block in trie.go (around line 1082) and the ibsen slice in routingpreserve_test.go (around line 45) warrant a second look.

Important Files Changed

Filename Overview
trie.go Adds chainSampleSmallMax constant and bifurcates chainSample into 2-window/halved-cap path for n < 16384 and 4-window/full-cap path otherwise; chainWalk gains maxSteps/maxExc parameters. Logic is sound but the comment describing "every chunk of such a dispatch takes the reduced budget" is incorrect for the narrow set of 16384-byte chunks that ceiling-division produces at the top of the gate-sampled band.
routingpreserve_test.go New tripwire test asserting dual-vs-single routing verdicts on both sides of the budget threshold; well-structured, but slices ibsen directly to 96 KiB without a length guard, which would panic if the test-data file were ever replaced with a smaller fixture.
samplepolicy_bench_test.go New benchmark matrix covering the gate-sampled dense band, hetero inputs, false-start corpus, gray-zone separators, and chainSample cost directly; assertRegime pins dispatch regime with a fixed maxProcs=64 so benchmarks cannot silently measure the wrong path. Well-implemented with no bugs found.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["chainSample(input)"] --> B{n < chainSampleSmallMax = 16384?}
    B -- Yes --> C["2 windows at n/4 and 3n/4\nmaxSteps=128, maxExc=12"]
    B -- No --> D["4 windows at n/8,3n/8,5n/8,7n/8\nmaxSteps=256, maxExc=24"]
    C --> E["chainWalk per window"]
    D --> E
    E --> G{Vote}
    G -- "chainBytes>=64 AND chainBytes>=24*exc" --> H["long++"]
    G -- "exc>=8 AND chainBytes<6*exc" --> I["short++"]
    G -- otherwise --> J["abstain"]
    H & I & J --> K["return long, short"]
    K --> L{long > short?}
    L -- Yes --> M["dual-cursor scan"]
    L -- No --> N{short > long?}
    N -- Yes --> O["single-cursor scan"]
    N -- No --> P["looksDense tie-break"]
    P --> Q{dense?}
    Q -- Yes --> M
    Q -- No --> O
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["chainSample(input)"] --> B{n < chainSampleSmallMax = 16384?}
    B -- Yes --> C["2 windows at n/4 and 3n/4\nmaxSteps=128, maxExc=12"]
    B -- No --> D["4 windows at n/8,3n/8,5n/8,7n/8\nmaxSteps=256, maxExc=24"]
    C --> E["chainWalk per window"]
    D --> E
    E --> G{Vote}
    G -- "chainBytes>=64 AND chainBytes>=24*exc" --> H["long++"]
    G -- "exc>=8 AND chainBytes<6*exc" --> I["short++"]
    G -- otherwise --> J["abstain"]
    H & I & J --> K["return long, short"]
    K --> L{long > short?}
    L -- Yes --> M["dual-cursor scan"]
    L -- No --> N{short > long?}
    N -- Yes --> O["single-cursor scan"]
    N -- No --> P["looksDense tie-break"]
    P --> Q{dense?}
    Q -- Yes --> M
    Q -- No --> O
Loading
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
trie.go:1082-1086
**Comment claims all band chunks take reduced budget — not true for the ceiling-division edge**

The comment states "so every chunk of such a dispatch…takes the reduced budget", but `matchParallel` uses ceiling division (`chunk = (len(input) + p - 1) / p`), so a near-ceiling input such as 131 071 bytes (= `parallelSparseMin - 1`) split across 8 workers produces chunks of exactly 16 384 bytes (`ceil(131071/8) = 16384`). Since the check is `n < chainSampleSmallMax` (strict), those 16 384-byte chunks fall through to the full four-window budget, contradicting the comment.

The behavior is not wrong — using the full budget for a 16 KB chunk is safe and keeps routing correct — but the comment should be amended to say "chunks strictly less than `chainSampleSmallMax`" or the threshold changed to `<=` to cover those 7 edge sizes at the top of the band.

### Issue 2 of 2
routingpreserve_test.go:45-53
**Unguarded 96 KiB slice on `ibsen` panics if the file is replaced**

`ibsen[:96<<10]` is used directly with no prior length check. If `Ibsen.txt` is ever swapped for a shorter fixture (or truncated in CI), the test panics with an index out of range rather than producing a useful failure message. A `t.Fatalf` guard after `mustRead` would make the failure diagnostic instead of a crash.

Reviews (1): Last reviewed commit: "perf: scale chainSample's budget down at..." | Re-trigger Greptile

Comment thread trie.go Outdated
Comment thread routingpreserve_test.go
Comment thread routingpreserve_test.go
Comment thread samplepolicy_bench_test.go Outdated
Comment thread samplepolicy_bench_test.go Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • samplepolicy_bench_test.go
  • trie.go
Previous Review Summaries (3 snapshots, latest commit 0a2b435)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 0a2b435)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

SUGGESTION

File Line Issue
samplepolicy_bench_test.go 35 The shared CPU guard skips direct and sequential benchmarks that do not depend on worker geometry
trie.go 1086 The sampler comment narrates change history instead of only the current invariant

Fix these issues in Kilo Cloud

Files Reviewed (4 files)
  • dualscan_test.go - 0 issues
  • routingpreserve_test.go - 0 issues
  • samplepolicy_bench_test.go - 1 issue
  • trie.go - 1 issue

Previous review (commit 5771575)

Status: 17 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 14
Issue Details (click to expand)

WARNING

File Line Issue
trie.go 1135 Reducing to two windows lets two local pockets overturn a predominantly long-chain sample
samplepolicy_bench_test.go 69 The fixed 64-CPU assertion can validate a different dispatch path than the benchmark measures
trie.go 1132 The sampling phase is inferred from overlap-expanded worker slices rather than owned chunk size

SUGGESTION

File Line Issue
trie.go 1086 The comment incorrectly says every gate-sampled chunk uses the reduced budget
routingpreserve_test.go 39 The word-like corpus is a density-decided gray-zone case, not a long-chain override
routingpreserve_test.go 53 Fixed-size fixture slices can panic without a diagnostic length guard
samplepolicy_bench_test.go 39 spDenseCorpus forwards an unused tr parameter through every caller
samplepolicy_bench_test.go 148 The comment narrates PR and variant history rather than a durable invariant
trie.go 1103 The sequential sampler threshold is coupled to the parallel sparse dispatch threshold
routingpreserve_test.go 30 The test uses routing internals without asserting the trie shape they require
routingpreserve_test.go 26 Concatenated-corpus construction duplicates the existing concat helper
routingpreserve_test.go 79 mustRead duplicates the existing testing.TB file-reading helper
samplepolicy_bench_test.go 29 spTrie duplicates the existing 16-bit single-stop trie fixture
samplepolicy_bench_test.go 52 The sparse filler duplicates existing root-skipping fixture behavior
samplepolicy_bench_test.go 90 The setup assertion is included in benchmark timing
samplepolicy_bench_test.go 139 Heterogeneous rows do not assert the worker-local route they claim to measure
samplepolicy_bench_test.go 297 A serial microbenchmark is presented as a bound on contended worker cost

Fix these issues in Kilo Cloud

Files Reviewed (3 files)
  • routingpreserve_test.go - 5 issues
  • samplepolicy_bench_test.go - 8 issues
  • trie.go - 4 issues

Previous review (commit 32b404f)

Status: 7 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 5
Issue Details (click to expand)

WARNING

File Line Issue
trie.go 1135 Reducing to two windows lets two local pockets overturn a predominantly long-chain sample
samplepolicy_bench_test.go 69 The fixed 64-CPU assertion can validate a different dispatch path than the benchmark measures

SUGGESTION

File Line Issue
trie.go 1086 The comment incorrectly says every gate-sampled chunk uses the reduced budget
routingpreserve_test.go 39 The word-like corpus is a density-decided gray-zone case, not a long-chain override
routingpreserve_test.go 53 Fixed-size fixture slices can panic without a diagnostic length guard
samplepolicy_bench_test.go 39 spDenseCorpus forwards an unused tr parameter through every caller
samplepolicy_bench_test.go 148 The comment narrates PR and variant history rather than a durable invariant

Fix these issues in Kilo Cloud

Files Reviewed (3 files)
  • routingpreserve_test.go - 2 issues
  • samplepolicy_bench_test.go - 3 issues
  • trie.go - 2 issues

Reviewed by gpt-5.6-sol · Input: 90K · Output: 6.4K · Cached: 699.7K

Four 1KB windows under full caps cover a third of a 12KB parallel
chunk - 8x the sampling fraction the same code applies to a whole 96KB
input - and every worker of a dense-verdict dispatch walks that budget
concurrently before scanning its chunk, ~17us of the critical path at
96-127KB. Inputs under chainSampleSmallMax (the largest gate-sampled
chunk, parallelSparseMin/8) now sample two windows under halved caps;
the cap ratio is preserved so the long/short vote bars are unchanged
and only the evidence budget shrinks.

Measured (Graviton3, n=24, interleaved executions): dense 96KB -4.8%,
127KB -3.3%, sequential 12KB dense -9.4%, gate-edge separator corpora
-5.5/-5.9%; shallow-chain dense input keeps its single-cursor routing
at every size (TestRoutingPreserved pins the verdicts on both sides of
the budget threshold), sparse and >=16KB-chunk paths unchanged.
@ahrav
ahrav force-pushed the perf/33-sse2-kernels branch from aebf57f to ea55e49 Compare July 14, 2026 18:16
@ahrav
ahrav force-pushed the perf/34-chunk-scale-chain-sampling branch from 32b404f to 5771575 Compare July 14, 2026 18:16
Comment thread trie.go
Comment thread trie.go
Comment thread routingpreserve_test.go
Comment thread routingpreserve_test.go Outdated
Comment thread routingpreserve_test.go Outdated
Comment thread samplepolicy_bench_test.go Outdated
Comment thread samplepolicy_bench_test.go Outdated
Comment thread samplepolicy_bench_test.go
Comment thread samplepolicy_bench_test.go
Comment thread samplepolicy_bench_test.go Outdated
Base automatically changed from perf/33-sse2-kernels to master July 16, 2026 12:40
…comment scope fixes

- assertRegime evaluates the dispatch at runtime.GOMAXPROCS(0) (the
  same value Match uses) instead of a hard-coded 64, and resets the
  timer after passing so the assertion cost stays out of short runs.
- TestRoutingPreserved guards the Ibsen fixture length, asserts the
  trie shape via buildStopByte16Trie (now testing.TB), and reuses
  concat; spDenseCorpus drops its unused param and reuses concat;
  spSparseFiller replaced by bytesFill; mustRead replaced by
  benchReadFile.
- chainSampleSmallMax comment scopes the reduced-budget claim to the
  ceiling-division/overlap edges; chainSample cost bench comment
  states the solo figure is an uncontended floor, not a bound.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0de9278f72

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread samplepolicy_bench_test.go
Below GOMAXPROCS=8 the dispatcher hands out fewer, larger chunks
(96KiB across 4 workers is 24KiB chunks), which take the full sampling
budget under row names that promise the reduced one. spTrie now skips
the file loudly on constrained runners instead of letting assertRegime
pass on p>0 while the rows time the wrong policy regime.
Comment thread samplepolicy_bench_test.go Outdated
Comment thread trie.go Outdated
spTrie gated every SP row on GOMAXPROCS>=8, skipping sequential
controls and the looksDense/chainSample microbenchmarks that have no
worker-count dependency. The gate now lives in spGate8, called only by
the groups whose rows document 8-worker chunk geometry (DenseBand,
Hetero, FalseStart, Gray). Also drop a change-relative word from the
chainSampleSmallMax comment.
@ahrav
ahrav merged commit 1e0b467 into master Jul 16, 2026
4 checks passed
@ahrav
ahrav deleted the perf/34-chunk-scale-chain-sampling branch July 16, 2026 19:35
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.

1 participant