Reins steers thread schedules toward concurrency bugs
REINS: Agent-guided Thread Scheduling for Concurrency Bug Detection and Reproduction · arXiv:2610.13421
In plain words
A bug in a multithreaded program can appear only when threads run in a particular order and shared data has the right value. Reins is a system that uses an agent’s ideas about such bugs to guide thread scheduling, then checks those ideas by running the program.
On a test collection with injected bugs, Reins triggered more distinct bugs than the strongest comparison system under the same inputs and five-hour limit per target. The test used one supplied input per program variant, which did not trigger every injected bug.
The research
A concurrency bug may depend on a narrow combination of thread order and shared-data state, making it hard to reproduce within a limited testing budget. Can reasoning about a program’s behavior guide the scheduler toward those rare executions, and can real runs check whether that reasoning is right?
Reins turns an agent’s concurrency-bug hypotheses into checked scheduling constraints, then uses program executions to refine them.
In RaceBench, a test collection with injected concurrency bugs, the researchers counted distinct bugs triggered across 75 program variants.
Reins triggered 769 of 1,500, compared with 731 for the strongest baseline on the total; all tools used the same supplied input for each variant and had five hours per target.
The higher total supports Reins’s performance in this test setup. Because the seed input did not expose every injected bug, the result covers only bugs triggerable with those inputs and within that time budget.
These results come from one run per tool and configuration using a single model. Reins currently covers reached C/C++ shared-memory code and failures that cause crashes, assertion failures or hangs.
What the evidence shows
- The rare-schedule problem
Reins is a system for detecting and reproducing concurrency bugs in shared-memory multithreaded programs. These bugs can depend on a particular order of thread actions and specific values in shared data.
Since a program may have many possible schedules, testing can miss the narrow sequence that causes a visible failure within its time budget.
- Turning ideas into runs
The system uses an agent to inspect observed shared-variable accesses alongside source code and static information. From these, it proposes a hypothesis about which interactions could cause a failure, then turns that hypothesis into requirements for event order and variable state.
The scheduler can check those requirements against real executions instead of treating an agent’s explanation as proof.
- A higher injected-bug total
In RaceBench, a test collection with injected concurrency bugs, the researchers counted distinct bugs triggered across 75 program variants. With the same supplied input for each variant and five hours per target, Reins triggered 769 of 1,500 bugs, compared with 731 for the strongest baseline on the total. The count reflects this test setup; its seed inputs did not expose every injected bug.
- Fewer schedules to trigger
A separate comparison on programs with known bugs found that Reins triggered its detected bugs within about 100 schedules, while baseline methods had long tails of 1,000 to 10,000 schedules on hard programs. The overall detection totals showed no significant advantage there.
The authors interpret the schedule counts as evidence that the constraints focused exploration, rather than as proof that Reins detects more bugs in every setting.
- Clues and real projects
The researchers also removed runtime observations from candidate proposal on five x264 variants. The share of dispatched subagents whose plans triggered a bug fell from 17.6% to 6.6%, suggesting runtime clues helped in that test.
In separate runs on NSPR and SpiderMonkey, Reins found six previously unknown bugs; developers had confirmed three SpiderMonkey bugs at the time of writing.
Deep
- Original paper authors
- Yu Zhang, Corina S. Pasareanu, Guowei Yang
- Submitted to arXiv
- License
- arXiv non-exclusive