Skip to content

[pulse] record disjuncts skipped by the balanced disjunct strategy as dropped - #2168

Open
VladimirMakaev wants to merge 1 commit into
meta:mainfrom
VladimirMakaev:pulse-balanced-disjunct-accounting
Open

VladimirMakaev wants to merge 1 commit into
meta:mainfrom
VladimirMakaev:pulse-balanced-disjunct-accounting

Conversation

@VladimirMakaev

@VladimirMakaev VladimirMakaev commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

With --pulse-balanced-disjuncts-strategy, pre disjuncts left without budget at a node (more of
them than room in its post) still ran the node's first instruction with a limit of 0, then
vanished: they were neither counted as dropped nor joined into the over-approximate state. This
loses, e.g., transitive accesses at loop heads, and every report with --pulse-max-disjuncts 0 --pulse-over-approximate-reasoning:

// infer --pulse-balanced-disjuncts-strategy --pulse-max-disjuncts 0
//       --pulse-over-approximate-reasoning
int uninit_one_branch_bad(int b) {
  int x;
  if (b) {
    x = 42;
  }
  return x; // Infer missed: uninitialized value
}

They are now skipped without being executed and recorded as dropped, as the default strategy
(unchanged) does once the post is full, which is exactly when a balanced disjunct gets no budget.
The pulse_disjuncts_dropped stat now counts them.

Test plan

New c/pulse-over-only-balanced runs the c/pulse-over-only tests with the balanced strategy and
expects the same issues (none before). build_systems/disjunctive_domain: balanced loop records
7 (was 5) and 10 (was 6) dropped disjuncts. All codetoanalyze tests pass.

@meta-cla meta-cla Bot added the CLA Signed label Oct 2, 2026
@VladimirMakaev
VladimirMakaev force-pushed the pulse-balanced-disjunct-accounting branch from 79bac0e to 6bd2545 Compare October 3, 2026 19:53
@VladimirMakaev VladimirMakaev changed the title [DRAFT] [pulse] record disjuncts skipped by the balanced disjunct strategy as dropped [pulse] record disjuncts skipped by the balanced disjunct strategy as dropped Oct 5, 2026
@VladimirMakaev
VladimirMakaev marked this pull request as ready for review October 5, 2026 15:27
VladimirMakaev added a commit to VladimirMakaev/infer that referenced this pull request Oct 5, 2026
… dropped

With `--pulse-balanced-disjuncts-strategy`, pre disjuncts left without budget at a node (more of
them than room in its post) still ran the node's first instruction with a limit of 0, then
vanished: they were neither counted as dropped nor joined into the over-approximate state. This
loses, e.g., transitive accesses at loop heads, and every report with `--pulse-max-disjuncts 0
--pulse-over-approximate-reasoning`:

Upstream-PR: meta#2168
PR-Head: 6bd2545
PR-Base: 9cc2641
@dulmarod

dulmarod commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

@jvillard could you take a look?

@VladimirMakaev
VladimirMakaev force-pushed the pulse-balanced-disjunct-accounting branch from 6bd2545 to 70141b9 Compare October 7, 2026 15:55
@jvillard

jvillard commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

I don't think this strategy is used anywhere, looks like an old experiment to me. @davidpichardie any idea? Should the balanced strategy be removed, kept as-is, or should this PR be merged?

… dropped

With `--pulse-balanced-disjuncts-strategy`, pre disjuncts left without budget at a node (more of
them than room in its post) still ran the node's first instruction with a limit of 0, then
vanished: they were neither counted as dropped nor joined into the over-approximate state. This
loses, e.g., transitive accesses at loop heads, and every report with `--pulse-max-disjuncts 0
--pulse-over-approximate-reasoning`:

```c
// infer --pulse-balanced-disjuncts-strategy --pulse-max-disjuncts 0
//       --pulse-over-approximate-reasoning
int uninit_one_branch_bad(int b) {
  int x;
  if (b) {
    x = 42;
  }
  return x; // Infer missed: uninitialized value
}
```

They are now skipped without being executed and recorded as dropped, as the default strategy
(unchanged) does once the post is full, which is exactly when a balanced disjunct gets no budget.
The `pulse_disjuncts_dropped` stat now counts them.

## Test plan

New `c/pulse-over-only-balanced` runs the `c/pulse-over-only` tests with the balanced strategy and
expects the same issues (none before). `build_systems/disjunctive_domain`: balanced `loop` records
7 (was 5) and 10 (was 6) dropped disjuncts. All codetoanalyze tests pass.
@VladimirMakaev
VladimirMakaev force-pushed the pulse-balanced-disjunct-accounting branch from 70141b9 to 4159413 Compare November 20, 2026 16:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants