[WIP] backtest: use [layout.affinity] so multiple instances can share a box - #11408
Open
kbhargava-jump wants to merge 1 commit into
Open
[WIP] backtest: use [layout.affinity] so multiple instances can share a box#11408kbhargava-jump wants to merge 1 commit into
kbhargava-jump wants to merge 1 commit into
Conversation
┌─ ⚡ PERF · 47f736d vs main@aa3206d ─────────────────────────────────
│ SUITE BASELINE NEW Δ
+│ replay tps, mainnet 29,690 tps 29,849 tps ▲ +0.53%
│ bench tps, localnet 128,647 tps 128,646 tps · 0.00%
│ snapshot load, testnet 15.28 s 15.28 s · 0.00%
│ mem total, mainnet 171.44 GiB 171.44 GiB · 0.00%
│ mem total, testnet 102.31 GiB 102.31 GiB · 0.00%
│ clean compile, firedancer 309.4 cpu·s 309.3 cpu·s · -0.05%
│ binary size, firedancer 85.87 MB 85.87 MB · 0.00%
├─────────────────────────────────────────────────────────────────────
@@ 0 REGRESSIONS · 0 WARNINGS · 1 IMPROVED · 6 NOISE @@
└───────────────────────────────────────────────────────────────────── |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Explicit affinity currently mishandles floating entries, shifts mappings after the diagnostic tile, and permits mismatched entry counts.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds configurable CPU affinity to the Firedancer backtest topology.
Changes:
- Parses
[layout.affinity]. - Assigns configured CPUs to backtest tiles.
File summaries
| File | Description |
|---|---|
src/app/firedancer-dev/commands/backtest.c |
Applies layout affinity while constructing backtest tiles. |
Review details
Suppressed comments (1)
src/app/firedancer-dev/commands/backtest.c:83
- A non-
autoaffinity with too few entries is silently accepted because this fallback floats every remaining tile; extra entries are also never reported. That defeats explicit CPU isolation and differs from the normal topology's count validation. After all conditional tiles are added, requireaffinity_tile_cntto matchtopo->tile_cnt(or explicitly document and validate another contract).
# define NEXT_CPU ( is_auto_affinity ? cpu_idx++ : ( cpu_idx<affinity_tile_cnt ? (ulong)parsed_tile_to_cpu[ cpu_idx++ ] : ULONG_MAX ) )
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| affinity_tile_cnt = fd_topob_parse_affinity_cstr( config->layout.affinity, parsed_tile_to_cpu, 1 ); | ||
|
|
||
| ulong cpu_idx = 1; | ||
| # define NEXT_CPU ( is_auto_affinity ? cpu_idx++ : ( cpu_idx<affinity_tile_cnt ? (ulong)parsed_tile_to_cpu[ cpu_idx++ ] : ULONG_MAX ) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.