Skip to content

mask-risc tests: count allocations per thread in borrowed_alloc and oracle_alloc - #1354

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/sharp-bardeen-8nlu1z-alloc-flake
Oct 6, 2026
Merged

AdaWorldAPI merged 1 commit into
mainfrom
claude/sharp-bardeen-8nlu1z-alloc-flake

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Problem

borrowed_alloc failed in the Rust Tests test job on #1349's head (run 37450481656):

the borrowed arena allocated 900 bytes across ten row counts

#1349 did not touch mask-risc.

Cause

The test measures allocations with a process-global AtomicUsize. libtest keeps its own threads running while the test body runs, and those threads can allocate while the measured window is open. no_alloc.rs had already recorded the same contamination at 790 bytes.

I reproduced it locally with CI's -C target-cpu=x86-64-v3, so this is not a SIMD-tier issue. The unchanged binary failed 1 run in 300 under CPU load (6 × yes).

Fix

borrowed_alloc.rs and oracle_alloc.rs now use the thread-local Cell counter that fused_ternlog.rs, fused_terminal.rs and program_collapse.rs already use. Every measured window runs on the test thread, so counting only that thread is exact. The module docs that described the counter as process-global are updated.

Verification

  • Under the same load: 0 failures in 300 runs of each binary.
  • The counter still catches real allocations: an 8-byte allocation planted inside borrowed_alloc's measured window turns the test red (80 bytes reported). Both existing can-it-fire probes are unchanged and pass.
  • Gates: cargo test, clippy -D warnings and fmt are clean for lance-graph-mask-risc.

Scope: test-only; no library code changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MHMvKHLhM6xwRswKY4s6vY


Generated by Claude Code

…racle_alloc

borrowed_alloc failed in CI on #1349's head with 900 stray bytes. Its
counter was a process-global AtomicUsize, and libtest's own threads
allocate while the measured window is open. Under CPU load the unchanged
binary failed 1 run in 300 locally with CI's -C target-cpu=x86-64-v3;
nothing in mask-risc had changed.

Both files now use the thread-local Cell counter that fused_ternlog,
fused_terminal and program_collapse already use. Every measured window
runs on the test thread, so the count is exact. After the change: 0
failures in 300 runs of each binary under the same load. A planted
8-byte allocation inside borrowed_alloc's window still turns it red
(80 bytes), and both can-it-fire probes are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MHMvKHLhM6xwRswKY4s6vY
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 66 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: ce203e7f-093d-4437-812a-c649f9597c1a
📥 Commits

Reviewing files that changed from the base of the PR and between 3290a9c and 6cf5947.

📒 Files selected for processing (2)
  • crates/lance-graph-mask-risc/tests/borrowed_alloc.rs
  • crates/lance-graph-mask-risc/tests/oracle_alloc.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


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

@cursor

cursor Bot commented Oct 6, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: dc2696fa-3079-401c-ae5e-e1e3d059cbe6)

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 6, 2026 10:57
@AdaWorldAPI
AdaWorldAPI merged commit ae82c5d into main Oct 6, 2026
8 of 9 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T10:58:01.678070Z 6cf5947 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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