Skip to content

feat: Fair scheduling with strict priorities - #833

Closed
danielpetri1 wants to merge 10 commits into
n0-computer:matheus23/deprecate-send-fairnessfrom
danielpetri1:eps-scheduling
Closed

danielpetri1 wants to merge 10 commits into
n0-computer:matheus23/deprecate-send-fairnessfrom
danielpetri1:eps-scheduling

Conversation

@danielpetri1

@danielpetri1 danielpetri1 commented Oct 5, 2026 •

Copy link
Copy Markdown

Description

Extends the fair stream scheduling behavior to allow strict sending within that urgency level.

This is achieved by adding a per-stream incremental parameter, following RFC 9218 semantics.

The incremental flag controls whether that stream can be multiplexed with others at the same urgency level. Non-incremental streams are scheduled before incremental ones. Ties in the non-incremental case are broken by favoring earlier stream IDs (not the write order anymore).

API Changes

Notes & open questions

  • The default incremental parameter is set to true to retain fair scheduling across all streams

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All API changes documented.
  • This PR was created by a human that thought critically about the
    proposed change and wrote an as clear and concise description as
    they could.
  • This PR isn't slop, and is carefully crafted to do have the
    intented effect.
  • cargo make passes locally.

@n0bot n0bot Bot added this to iroh Oct 5, 2026
@matheus23

Copy link
Copy Markdown
Member

@danielpetri1 how much simpler would your implementation become if we deprecated send_fairness(false) and removed all logic related to it? We're considering it, especially when we have a replacement feature like incremental=false.

@danielpetri1

Copy link
Copy Markdown
Author

Thanks for considering it! I believe that the implementation would become simpler and easier to maintain. If I'm allowed to break stuff, could implement it like that alongside #817.

@matheus23

Copy link
Copy Markdown
Member

No, breaking changes are not acceptable, but removing the send_fairness feature and marking that function as deprecated is fine.

We won't accept breaking changes to the API unfortunately :/

scheduling

Always schedule equal-priority streams round-robin, removing
continuation handling before introducing stream affinity. Keep the
setter as a deprecated no-op for source compatibility.
@matheus23

matheus23 commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Feel free to rebase on top of #835 and use it as a merge target for this PR, if you want.

@danielpetri1
danielpetri1 changed the base branch from main to matheus23/deprecate-send-fairness October 15, 2026 10:47
@danielpetri1
danielpetri1 marked this pull request as ready for review October 15, 2026 18:12
@danielpetri1

Copy link
Copy Markdown
Author

Rebased it to target your branch. After considering the discussion, I've retained send_fairness by making it serve as the default incremental value. It's not the exact same behavior, though (cf. the unfair_priority_bump test).

@flub
flub force-pushed the matheus23/deprecate-send-fairness branch from 1438f7f to 8cfde5e Compare October 21, 2026 12:28
@matheus23
matheus23 force-pushed the matheus23/deprecate-send-fairness branch from 8cfde5e to b0f0f8e Compare October 21, 2026 14:10
@matheus23
matheus23 deleted the branch n0-computer:matheus23/deprecate-send-fairness October 22, 2026 09:18
@matheus23 matheus23 closed this Oct 22, 2026
@github-project-automation github-project-automation Bot moved this from 🚑 Needs Triage to ✅ Done in iroh Oct 22, 2026
@matheus23

Copy link
Copy Markdown
Member

Sorry for this - this is automated github behavior. The underlying base branch was merged now (which automatically closes this PR...). Can you direct the PR at main again? This should be possible without conflicts now.

@danielpetri1

danielpetri1 commented Oct 22, 2026 •

Copy link
Copy Markdown
Author

No problem, I'll open a new PR. Should I keep send_fairness as a no-op or retain it as the default incremental value?

@matheus23

Copy link
Copy Markdown
Member

Default incremental is the way to go! Thank you

Stanley00 pushed a commit to stanley-fork/noq that referenced this pull request Oct 22, 2026
…n0-computer#835)

## Description

Always schedule equal-priority streams round-robin, removing
continuation handling before introducing stream affinity. Keep the
setter as a deprecated no-op for source compatibility.

## API Changes

- `noq::TransportConfig::send_fairness` is now deprecated.

## Notes & open questions

We might want to wait for n0-computer#833 before we release with this PR, so we can
have an alternative to link to in deprecation documentation (the
`incremental=false` setting).

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All API changes documented.
- [x] `cargo make` passes locally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants