Skip to content

pci: keep a page a sub-page bar shares off another bar's run - #727

Open
steigr wants to merge 1 commit into
techomancer:mainfrom
steigr:feature/pci-sub-page-bar-keeps-page-off-runs
Open

steigr wants to merge 1 commit into
techomancer:mainfrom
steigr:feature/pci-sub-page-bar-keeps-page-off-runs

Conversation

@steigr

@steigr steigr commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

pci: keep a page a sub-page bar shares off another bar's run

Decode::mappings publishes the pages one BAR decodes whole, so a host
can map them straight to the function. It checked for overlap only
between the BARs that cover at least one whole page, so a BAR smaller
than a page lying inside a larger BAR's page left that page to the
larger BAR: a run over it sent the processor's accesses to the larger
BAR, while the host's own decode answered the same addresses from the
smaller one. Every BAR in the window now counts as a claim on the bytes
it decodes, and a page any other BAR claims gets no run, as overlapping
whole-page BARs already did.

Found while porting a per-head table to the Fuel's XBridge, whose tests
compare the direct path with the host decode at every address.

Test: a_sub_page_bar_inside_another_bars_page_keeps_the_page_off_the_runs
(fails without the change; with the small BAR disabled the larger one
gets its run back).

Upstream's tests did not cover the case and no guest is known to hit it; the new test fails on main without the change.

Tested on macOS arm64 at the tip: cargo test --workspace --no-fail-fast with --features jitv2,rex-jit,gputrace and with default features, and cargo build --release -p iris --bins --features lightning,jitv2,gpujit,idle-pause,hostgl. No failures beyond those upstream main shows on the same host (port-forward restarts, wgpu with no adapter, chd_synced_writes_survive_an_exit_that_skips_drop, resident_plane_raw_pointer_faults_in_child_processes). kona::back::tiles::tests::a_tiled_run_is_bit_exact_with_the_inline_one was skipped: on main it hangs there under load (the producer spins in Tiles::submit/retire while every worker sleeps) and passes alone.

🤖 Generated with Claude Code

Decode::mappings publishes the pages one BAR decodes whole, so a host
can map them straight to the function. It checked for overlap only
between the BARs that cover at least one whole page, so a BAR smaller
than a page lying inside a larger BAR's page left that page to the
larger BAR: a run over it sent the processor's accesses to the larger
BAR, while the host's own decode answered the same addresses from the
smaller one. Every BAR in the window now counts as a claim on the bytes
it decodes, and a page any other BAR claims gets no run, as overlapping
whole-page BARs already did.

Found while porting a per-head table to the Fuel's XBridge, whose tests
compare the direct path with the host decode at every address.

Test: a_sub_page_bar_inside_another_bars_page_keeps_the_page_off_the_runs
(fails without the change; with the small BAR disabled the larger one
gets its run back).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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