Skip to content

feat(outbox): introduce the outbox state component#746

Merged
victor-dumitrescu merged 4 commits intomainfrom
vdum@rv-868
Feb 2, 2026
Merged

feat(outbox): introduce the outbox state component#746
victor-dumitrescu merged 4 commits intomainfrom
vdum@rv-868

Conversation

@victor-dumitrescu
Copy link
Copy Markdown
Contributor

@victor-dumitrescu victor-dumitrescu commented Jan 23, 2026

Closes RV-868.

What

This MR introduces a new PVM state component for the outbox.

Why

We need to support the outbox functionality for the RISC-V PVM. The state of the outbox needs to be captured in state commitments.

How

The outbox is initially implemented as a fixed-size array of levels, each of which are in turn a fixed-size array of messages. Once dynamically sized arrays become available, the outbox will switch to use these instead.

The outbox is configured with a size, which is the number of levels for which it can store messages. This is so that a smaller outbox can be used for testing. The maximum number of messages per level and the maximum size of a message are outbox constants and not configurable by the PVM.

The outbox implements all the traits required to be added as a component of the PVM state. The initial interface for writing and reading messages is defined, but the functionality is not yet implemented.

Manually Testing

make all

Regressions

Altering the PVM state structure results in changes to regressions.

Tasks for the Author

  • Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes).
  • Eliminate dead code and other spurious artefacts introduced in your changes.
  • Document new public functions, methods and types.
  • Make sure the documentation for updated functions, methods, and types is correct.
  • Add tests for bugs that have been fixed.
  • Explain changes to regression test captures when applicable.
  • Write commit messages in agreement with our guidelines.
  • Self-review your changes to ensure they are high-quality.
  • Complete all of the above before assigning this MR to reviewers.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 89.25620% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.49%. Comparing base (40f2494) to head (81ffeab).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/riscv/lib/src/pvm/outbox.rs 90.38% 0 Missing and 10 partials ⚠️
src/riscv/lib/src/pvm/common.rs 66.66% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #746      +/-   ##
==========================================
- Coverage   89.49%   89.49%   -0.01%     
==========================================
  Files         109      110       +1     
  Lines       20769    20888     +119     
  Branches    20769    20888     +119     
==========================================
+ Hits        18587    18693     +106     
  Misses       1803     1803              
- Partials      379      392      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@victor-dumitrescu victor-dumitrescu force-pushed the vdum@rv-868 branch 2 times, most recently from ce2d63a to f2d9e37 Compare January 27, 2026 16:06
@victor-dumitrescu victor-dumitrescu marked this pull request as ready for review January 27, 2026 16:25
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 27, 2026

Benchmark results for revision 8059e5e:

Metric Duration TPS
Mean 1.478874464s 27.048
Worst 1.488650175s 26.870
Best 1.471970777s 27.174
Standard Deviation ±4.787855ms ±0.088
Full results
Run Transfers Duration TPS
1 40 1.486116363s 26.916
2 40 1.479587466s 27.035
3 40 1.483494242s 26.963
4 40 1.482509146s 26.981
5 40 1.480002724s 27.027
6 40 1.482904176s 26.974
7 40 1.488650175s 26.870
8 40 1.482562085s 26.980
9 40 1.472306583s 27.168
10 40 1.476716478s 27.087
11 40 1.472833712s 27.159
12 40 1.477164834s 27.079
13 40 1.483178049s 26.969
14 40 1.480717428s 27.014
15 40 1.478352459s 27.057
16 40 1.473345501s 27.149
17 40 1.476203001s 27.097
18 40 1.476689143s 27.088
19 40 1.47218494s 27.170
20 40 1.471970777s 27.174

Compare the results above with those for the default branch.

Comment thread src/riscv/lib/src/pvm/outbox.rs
Comment thread src/riscv/lib/src/pvm/outbox.rs
@vapourismo
Copy link
Copy Markdown
Collaborator

Benchmark results for revision 923758d:

Metric Duration TPS
Mean 1.544861953s 25.893
Worst 1.557480239s 25.683
Best 1.532724079s 26.097
Standard Deviation ±6.920934ms ±0.116
Full results
Run Transfers Duration TPS
1 40 1.553918762s 25.741
2 40 1.542646705s 25.929
3 40 1.552139902s 25.771
4 40 1.537382024s 26.018
5 40 1.550761497s 25.794
6 40 1.543773288s 25.911
7 40 1.55007051s 25.805
8 40 1.53566341s 26.047
9 40 1.537054505s 26.024
10 40 1.551582606s 25.780
11 40 1.536111997s 26.040
12 40 1.557480239s 25.683
13 40 1.55126305s 25.785
14 40 1.544787858s 25.894
15 40 1.539875554s 25.976
16 40 1.546785598s 25.860
17 40 1.544595499s 25.897
18 40 1.549552508s 25.814
19 40 1.532724079s 26.097
20 40 1.539069471s 25.990
Compare the results above with those for the default branch.

Please investigate this performance regression.

@NSant215 NSant215 added the benchmark-trigger Force benchmark run for a PRs label Jan 28, 2026
@github-actions github-actions Bot removed the benchmark-trigger Force benchmark run for a PRs label Jan 28, 2026
Comment thread src/riscv/lib/src/pvm/outbox.rs Outdated
Comment thread src/riscv/lib/src/pvm/outbox.rs
Comment thread src/riscv/lib/src/pvm/outbox.rs Outdated
Comment thread src/riscv/lib/src/array_utils.rs Outdated
Comment thread src/riscv/lib/src/array_utils.rs Outdated
@victor-dumitrescu victor-dumitrescu force-pushed the vdum@rv-868 branch 2 times, most recently from 62bed94 to 60486f3 Compare January 29, 2026 14:28
@victor-dumitrescu victor-dumitrescu added the benchmark-trigger Force benchmark run for a PRs label Jan 29, 2026
@github-actions github-actions Bot removed the benchmark-trigger Force benchmark run for a PRs label Jan 29, 2026
Comment thread src/riscv/lib/src/pvm/outbox.rs Outdated
Comment thread src/riscv/lib/src/pvm/outbox.rs Outdated
Comment thread src/riscv/lib/src/pvm/outbox.rs Outdated
Comment thread src/riscv/lib/src/pvm.rs Outdated
Comment thread src/riscv/lib/src/pvm/outbox.rs Outdated
@zcabter zcabter self-requested a review January 30, 2026 13:40
@victor-dumitrescu
Copy link
Copy Markdown
Contributor Author

Please investigate this performance regression.

While this result shows a regression, comparing the current results with the current main doesn't seem to show it.

I couldn't reproduce locally (M1 MBP). I tried having the outbox as the second field of Pvm, keeping the decreasing ordering by size, but I also could not see an effect.

Comment thread src/riscv/lib/src/pvm/outbox.rs Outdated
Comment thread src/riscv/lib/src/pvm/outbox.rs Outdated
Comment thread src/riscv/lib/src/pvm/outbox.rs Outdated
@victor-dumitrescu victor-dumitrescu added this pull request to the merge queue Feb 2, 2026
Merged via the queue into main with commit 562088f Feb 2, 2026
8 checks passed
@victor-dumitrescu victor-dumitrescu deleted the vdum@rv-868 branch February 2, 2026 16:26
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.

5 participants