Skip to content

[WIP] backtest: use [layout.affinity] so multiple instances can share a box - #11408

Open
kbhargava-jump wants to merge 1 commit into
mainfrom
backtest-cpu-selection
Open

[WIP] backtest: use [layout.affinity] so multiple instances can share a box#11408
kbhargava-jump wants to merge 1 commit into
mainfrom
backtest-cpu-selection

Conversation

@kbhargava-jump

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI balanced review requested due to automatic review settings September 10, 2026 21:22
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
 ┌─ ⚡ 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 @@
 └─────────────────────────────────────────────────────────────────────

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-auto affinity 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, require affinity_tile_cnt to match topo->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 ) )
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.

2 participants