Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
ca29a48
wip
venkkatesh-sekar Mar 20, 2026
ff973ae
test
venkkatesh-sekar Mar 20, 2026
c38d823
test
venkkatesh-sekar Mar 20, 2026
5058129
test
venkkatesh-sekar Mar 20, 2026
644e63a
as
venkkatesh-sekar Mar 20, 2026
b7d9934
as
venkkatesh-sekar Mar 20, 2026
7999e44
as
venkkatesh-sekar Mar 20, 2026
c5472d9
as
venkkatesh-sekar Mar 20, 2026
096bad4
as
venkkatesh-sekar Mar 20, 2026
228ed68
as
venkkatesh-sekar Mar 20, 2026
7a6b1b2
as
venkkatesh-sekar Mar 20, 2026
a59c9fb
as
venkkatesh-sekar Mar 20, 2026
c9c8349
Merge branch 'master' into vsekar/fmo
venkkatesh-sekar Mar 20, 2026
4bae9dd
as
venkkatesh-sekar Mar 20, 2026
4707aaa
test
venkkatesh-sekar Mar 20, 2026
2d423ae
Merge branch 'master' into vsekar/fmo
venkkatesh-sekar Mar 26, 2026
30dd611
test
venkkatesh-sekar Mar 26, 2026
c8d5796
test
venkkatesh-sekar Mar 26, 2026
a3db307
test
venkkatesh-sekar Mar 26, 2026
aef1fc5
test
venkkatesh-sekar Mar 26, 2026
73ffcb6
flush
venkkatesh-sekar Mar 26, 2026
fc1db26
v1
venkkatesh-sekar Mar 26, 2026
d33cb72
Merge branch 'master' into vsekar/fmo
venkkatesh-sekar Mar 26, 2026
d71935a
remove ordering
venkkatesh-sekar Mar 27, 2026
2a07aac
make queue check strong
venkkatesh-sekar Mar 27, 2026
b3a4ec5
clean
venkkatesh-sekar Mar 27, 2026
1b4f387
clean
venkkatesh-sekar Mar 27, 2026
14351de
fix
venkkatesh-sekar Mar 27, 2026
ec488ac
test
venkkatesh-sekar Mar 27, 2026
e9ff57c
test
venkkatesh-sekar Mar 27, 2026
164b93d
test
venkkatesh-sekar Mar 27, 2026
d315527
clean budget
venkkatesh-sekar Mar 27, 2026
bab9a43
Merge branch 'master' into vsekar/fmo
venkkatesh-sekar Mar 27, 2026
b195890
test
venkkatesh-sekar Mar 27, 2026
ed8f333
test
venkkatesh-sekar Mar 28, 2026
53ad375
Merge branch 'master' into vsekar/fmo
venkkatesh-sekar Mar 30, 2026
59010b5
merge fix
venkkatesh-sekar Mar 30, 2026
8d2177e
test
venkkatesh-sekar Apr 14, 2026
e3460a5
test
venkkatesh-sekar Apr 14, 2026
d6c2526
test
venkkatesh-sekar Apr 14, 2026
ce89565
test
venkkatesh-sekar Apr 14, 2026
28603ae
Merge branch 'master' into vsekar/fmo
venkkatesh-sekar Apr 14, 2026
531ea69
test
venkkatesh-sekar Apr 14, 2026
3453b6f
fix: loopback induction and subnet queue checks for flexible ordering
venkkatesh-sekar Apr 15, 2026
3ab30cf
refactor: rotate sender schedule instead of asserting front position
venkkatesh-sekar Apr 15, 2026
70cbd97
refactor: rename fmo to flexible_message_ordering, remove clear_flexi…
venkkatesh-sekar Apr 15, 2026
f73ffeb
refactor: rename buffer_ingress_as to ingress_message_with_flexible_o…
venkkatesh-sekar Apr 15, 2026
eef5c53
fix: panic on missing execution_state in set_next_scheduled_method
venkkatesh-sekar Apr 15, 2026
11366ce
refactor: move ordering_target init inside flexible_ordering branch
venkkatesh-sekar Apr 15, 2026
e255ae9
refactor: remove Arc<RwLock<SchedulerConfig>> from SchedulerImpl
venkkatesh-sekar Apr 15, 2026
bb2aa9c
Automatically fixing code for linting and formatting issues
Apr 15, 2026
9d5f310
refactor: pass SchedulerConfig through execute_round, remove from Sch…
venkkatesh-sekar Apr 15, 2026
2d81914
fix: pass scheduler_config to MessageRoutingImpl::new in replay
venkkatesh-sekar Apr 15, 2026
0da6445
fix: address copilot review comments
venkkatesh-sekar Apr 15, 2026
b186354
Merge branch 'master' into vsekar/fmo
venkkatesh-sekar Apr 15, 2026
b4ae0cf
fix: pass scheduler_config to drain_subnet_queues in test_utilities
venkkatesh-sekar Apr 15, 2026
d6970f7
refactor: avoid cloning SchedulerConfig per thread in execute_caniste…
venkkatesh-sekar Apr 15, 2026
14e3d1a
fix: use max_instructions_per_round for drain_subnet_messages round l…
venkkatesh-sekar Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 24 additions & 5 deletions rs/config/src/subnet_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ const INSTRUCTION_OVERHEAD_PER_CANISTER_FOR_FINALIZATION: NumInstructions =
// would cause the longest possible round of 4B instructions or 2 seconds.
const MAX_INSTRUCTIONS_PER_ROUND: NumInstructions = NumInstructions::new(4 * B);

/// Ideally we would split the per-round limit between subnet messages and
/// canister messages, so that their sum cannot exceed the limit. That would
/// make the limit for canister messages variable, which would break assumptions
/// of the scheduling algorithm. The next best thing we can do is to limit
/// subnet messages on top of the fixed limit for canister messages.
/// The value of the limit for subnet messages is chosen quite arbitrarily
/// as 1/16 of the fixed limit. Any other value in the same ballpark would
/// work here.
pub const SUBNET_MESSAGES_LIMIT_FRACTION: u64 = 16;

// Limit per `install_code` message. It's bigger than the limit for a regular
// update call to allow for canisters with bigger state to be upgraded.
const MAX_INSTRUCTIONS_PER_INSTALL_CODE: NumInstructions = NumInstructions::new(300 * B);
Expand Down Expand Up @@ -277,6 +287,10 @@ pub struct SchedulerConfig {

/// Number of instructions to count when uploading or downloading binary snapshot data.
pub canister_snapshot_data_baseline_instructions: NumInstructions,

/// Per-round subnet message instruction budget.
/// Defaults to `max_instructions_per_round / SUBNET_MESSAGES_LIMIT_FRACTION`.
pub subnet_messages_per_round_instruction_limit: NumInstructions,
Comment thread
venkkatesh-sekar marked this conversation as resolved.
}

impl SchedulerConfig {
Expand Down Expand Up @@ -308,6 +322,8 @@ impl SchedulerConfig {
DEFAULT_CANISTERS_SNAPSHOT_BASELINE_INSTRUCTIONS,
canister_snapshot_data_baseline_instructions:
DEFAULT_CANISTERS_SNAPSHOT_DATA_BASELINE_INSTRUCTIONS,
subnet_messages_per_round_instruction_limit: MAX_INSTRUCTIONS_PER_ROUND
/ SUBNET_MESSAGES_LIMIT_FRACTION,
}
}

Expand All @@ -317,18 +333,19 @@ impl SchedulerConfig {
let max_instructions_per_install_code = NumInstructions::from(1_000 * B);
let max_instructions_per_slice = NumInstructions::from(2 * B);
let max_instructions_per_install_code_slice = NumInstructions::from(5 * B);
// Round limit is set to allow on average 2B instructions.
// See also comment about `MAX_INSTRUCTIONS_PER_ROUND`.
let max_instructions_per_round = max_instructions_per_slice
.max(max_instructions_per_install_code_slice)
+ NumInstructions::from(2 * B);
Self {
scheduler_cores: NUMBER_OF_EXECUTION_THREADS,
max_paused_executions: MAX_PAUSED_EXECUTIONS,
subnet_heap_delta_capacity: SUBNET_HEAP_DELTA_CAPACITY,
// TODO(RUN-993): Enable heap delta rate limiting for system subnets.
// Setting initial reserve to capacity effectively disables the rate limiting.
heap_delta_initial_reserve: SUBNET_HEAP_DELTA_CAPACITY,
// Round limit is set to allow on average 2B instructions.
// See also comment about `MAX_INSTRUCTIONS_PER_ROUND`.
max_instructions_per_round: max_instructions_per_slice
.max(max_instructions_per_install_code_slice)
+ NumInstructions::from(2 * B),
max_instructions_per_round,
max_instructions_per_message,
max_instructions_per_query_message,
max_instructions_per_slice,
Expand All @@ -352,6 +369,8 @@ impl SchedulerConfig {
upload_wasm_chunk_instructions: NumInstructions::from(0),
canister_snapshot_baseline_instructions: NumInstructions::from(0),
canister_snapshot_data_baseline_instructions: NumInstructions::from(0),
subnet_messages_per_round_instruction_limit: max_instructions_per_round
/ SUBNET_MESSAGES_LIMIT_FRACTION,
}
}

Expand Down
1 change: 1 addition & 0 deletions rs/determinism_test/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ pub(crate) fn setup() -> (
Arc::clone(&state_manager) as _,
Arc::clone(&execution_services.ingress_history_writer) as _,
execution_services.scheduler,
subnet_config.scheduler_config.clone(),
config.hypervisor.clone(),
Arc::clone(&execution_services.cycles_account_manager),
replica_config.subnet_id,
Expand Down
2 changes: 1 addition & 1 deletion rs/execution_environment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl ExecutionServices {
);

let scheduler = Box::new(SchedulerImpl::new(
subnet_config.scheduler_config,
subnet_config.scheduler_config.scheduler_cores,
config.embedders_config,
own_subnet_id,
Arc::clone(&ingress_history_writer) as Arc<_>,
Expand Down
Loading
Loading