Skip to content

Scope intermediate marker cover nodes to conversion - #22665

Draft
charliermarsh wants to merge 4 commits into
charlie/marker-isopfrom
charlie/marker-isop-workspace
Draft

charliermarsh wants to merge 4 commits into
charlie/marker-isopfrom
charlie/marker-isop-workspace

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Based on #22651.

We extract marker covers through a temporary interner that borrows existing nodes and cached operations from the global interner. New decision nodes and operation-cache entries belong to the conversion and are dropped after we render the cover into owned marker expressions.

This keeps intermediate ISOP functions from accumulating across distinct markers without adding another simplification implementation or changing the persistent marker representation. We reuse the same algebra and cover extraction code, but give their scratch state a shorter lifetime.

The tradeoff is that repeated conversions rebuild intermediate nodes instead of reusing them indefinitely. The regression test checks that cover extraction creates temporary nodes while leaving the parent's node table and operation cache unchanged.

Warm performance

Median time per operation in microseconds. Marker construction is outside the timed loop; each process reuses the global interner. Three randomized-order cohorts, with 16 timed samples per workload and revision, pinned to CPU 4 on an otherwise quiet devbox:

Workload Old stack (#22642) ISOP (#22651) This PR Change from #22651
Single-clause DNF 0.208 0.098 0.169 +0.071
Two-clause DNF 0.607 0.447 0.512 +0.064
Platform-specific Python versions 1.134 0.662 0.736 +0.073
Sparse DNF, 512 clauses 7,982.35 64.29 63.86 -0.43
Conflict DNF, 4 extras 4.509 1.643 2.746 +1.103
Conflict DNF, 16 extras 245.78 13.58 20.70 +7.12
Conflict DNF, 32 extras 2,946.57 45.63 64.75 +19.12
Dependent formatting, 4 extras 5.144 3.402 5.168 +1.766
Dependent formatting, 16 extras 880.04 29.07 38.52 +9.44
Dependent formatting, 32 extras 8,697.69 105.90 130.27 +24.37
Environment-only formatting, 32 extras 3,031.79 104.92 126.23 +21.31
Extra substitution, 8 independent pairs 2.285 2.277 2.258 -0.019

The small DNF cases add about 65–75 ns. The 32-extra conflict case adds 19 µs but remains about 46 times faster than the old stack. These are microbenchmarks, not an end-to-end resolver measurement; small differences in unchanged controls should be treated as noise. The reported run had no sustained competing work. The parent interner remains locked through cover rendering, with sorting outside the lock; these single-threaded measurements do not measure contention with other marker operations.

First conversion in a fresh process

Median of 20 randomized fresh-process samples, in microseconds. Input construction and process startup are outside the timer; allocator and code paths are cold:

Workload Old stack (#22642) ISOP (#22651) This PR
Single-clause DNF 17.45 14.25 16.15
Two-clause DNF 19.87 20.51 19.22
Platform-specific Python versions 19.67 23.08 21.70
Conflict DNF, 16 extras 292.15 39.07 36.69
Conflict DNF, 32 extras 3,175.33 93.52 103.28
Dependent formatting, 32 extras 9,396.50 168.31 175.73

Cold small-call results vary at the microsecond scale; they do not show the systematic warm-cache advantage of #22651.

Retained memory

Final live heap after constructing and converting distinct four-extra conflict markers in one process, with outputs dropped:

Distinct markers Old stack (#22642) ISOP (#22651) This PR
1 26.1 KiB 62.2 KiB 26.1 KiB
16 380.9 KiB 769.9 KiB 380.9 KiB
64 1.52 MiB 2.30 MiB 1.52 MiB
256 6.10 MiB 9.24 MiB 6.10 MiB
1,024 24.43 MiB 36.99 MiB 24.43 MiB

Each conversion retains zero additional bytes in this PR. Input construction still grows the persistent marker interner; we remove the additional growth from extracting covers. At 1,024 markers, peak RSS was 30.1 MiB for the old stack, 52.1 MiB for #22651, and 29.4 MiB for this PR. RSS is a coarse corroborating measurement; the table counts live Rust-requested allocation bytes over uv's Linux jemalloc allocator, not allocator metadata or reserved pages.

The benefit depends on allocation history: the full 25-workload sequence and a history of 64 distinct 32-extra markers ended with the same live heap in all three versions, since the extra nodes fit within already-allocated tables. The four-extra history above exposes the retained-capacity growth.

Peak working heap

Peak additional live heap during a warmed operation, excluding the already-built input and any state retained by earlier conversions:

Workload Old stack (#22642) ISOP (#22651) This PR
Two-clause DNF 784 B 448 B 448 B
Conflict DNF, 4 extras 1.77 KiB 1.47 KiB 14.92 KiB
Conflict DNF, 16 extras 77.23 KiB 15.80 KiB 35.04 KiB
Conflict DNF, 32 extras 571.23 KiB 69.17 KiB 122.77 KiB
Dependent formatting, 32 extras 1,114.03 KiB 90.83 KiB 122.88 KiB

The temporary arena raises transient memory on conflict workloads because we rebuild scratch state instead of retaining it between calls. Those allocations are freed after each conversion. For the four-extra case, #22651's first-call peak is 48.10 KiB, compared with 14.92 KiB here. The other listed cases have the same first-call and warmed peaks. Allocation counts were repeated in three fresh-process cohorts across all 25 workloads.

Measured on an AMD EPYC Milan Linux devbox with Rust 1.99.0-dev / Ohm 1.99.0-3. Revisions: #22642 at 21f4b07ecd5277ea4ee31d13c6ff71d49a85b754, #22651 at f9df0b826c93cecedab61c6594faa436e641867a, and this PR at 3867ce592925071fc9a1acdf7a0aa34a3e2d8657.

Borrow existing marker nodes and cached operations through a read-only parent interner. Keep new ISOP nodes and operation-cache entries in a temporary interner, and render owned expressions before dropping it.
@codspeed

codspeed Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 22.89%

2 warnings

⚠️ 6 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ Base and head ran on different runner types

Some benchmarks with significant performance changes were compared across different runner types, so the changes might not come from the code. Run base and head on the same runner type, or use CodSpeed Macro Runners for more stable results.

Learn more about Macro Runners

Open the report in CodSpeed to investigate

❌ 27 regressed benchmarks
✅ 90 untouched benchmarks
⏩ 54 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation marker_to_dnf_conflicting_extras[4] 59 µs 109.9 µs -46.36%
❌ CPU Simulation imbibe_and_format_marker_conflict_dependent[4] 86.7 µs 149.1 µs -41.83%
❌ CPU Simulation marker_to_dnf_conflicting_extras[16] 244.3 µs 380.4 µs -35.78%
❌ Walltime marker_to_dnf_conflicting_extras[4] 1.2 µs 1.9 µs -33.63%
❌ Walltime imbibe_and_format_marker_conflict_dependent[4] 2.2 µs 3.2 µs -32.84%
❌ Walltime marker_to_dnf_conflicting_extras[16] 11 µs 16 µs -31.23%
❌ CPU Simulation marker_to_dnf_conflicting_extras[32] 761.8 µs 1,096.4 µs -30.52%
❌ CPU Simulation imbibe_and_format_marker_environment_only[4] 97.5 µs 137.3 µs -29.01%
❌ CPU Simulation imbibe_marker_no_conflicts[0] 287.4 ns 398.5 ns -27.88%
❌ Walltime imbibe_and_format_marker_environment_only[4] 1.9 µs 2.6 µs -27.14%
❌ CPU Simulation imbibe_and_format_marker_conflict_dependent[16] 435.1 µs 583.9 µs -25.49%
❌ Walltime imbibe_and_format_marker_conflict_dependent[16] 18.4 µs 24.4 µs -24.36%
❌ Walltime marker_to_dnf_conflicting_extras[32] 36.9 µs 48.3 µs -23.59%
❌ CPU Simulation imbibe_and_format_marker_environment_only[16] 428.1 µs 553.4 µs -22.65%
❌ Walltime imbibe_and_format_marker_environment_only[16] 18.2 µs 23 µs -21.1%
❌ Walltime marker_to_dnf_single_clause 86 ns 108 ns -20.37%
❌ CPU Simulation imbibe_and_format_marker_conflict_dependent[32] 1.6 ms 1.9 ms -17.14%
❌ Walltime imbibe_and_format_marker_conflict_dependent[32] 65.1 µs 76.5 µs -14.91%
❌ CPU Simulation marker_to_dnf_single_clause 12.3 µs 14.4 µs -14.71%
❌ Walltime imbibe_and_format_marker_environment_only[32] 64.5 µs 75.6 µs -14.62%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing charlie/marker-isop-workspace (3867ce5) with charlie/marker-isop (f9df0b8)

Open in CodSpeed

Footnotes

  1. 54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

An error occurred while trying to automatically change base from charlie/marker-isop to charlie/direct-marker-transform October 18, 2026 03:24

This branch was previously deployed

1 inactive deployment
automations — 3867ce59 Deployed Oct 16, 2026 by charliermarsh via review / security review #51439
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