Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/v2/test/claim/ci_floor_plan_witness_test.dag
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import v2.workflow.ci_floor_plan {
witness_floor_spawn_width_zero_budget_falls_back,
witness_corpus_effective_widths_fit_runner_cap,
witness_execution_corpus_spawn_width_at_runner_cap,
witness_plan_spawn_width_is_min_floor_exec_at_runner_cap,
witness_plan_spawn_width_is_floor_width_at_runner_cap,
witness_floor_derived_width_leaves_headroom_at_cap,
}
import gunbc.ci_layer_roots { witness_discovery_scan_dirs, witness_layer_roots }
Expand Down Expand Up @@ -176,6 +176,6 @@ test fn ci_floor_spawn_width_live_budget_witnesses() -> Bool {
test fn ci_floor_honest_width_fold_witnesses() -> Bool {
witness_corpus_effective_widths_fit_runner_cap() &&
witness_execution_corpus_spawn_width_at_runner_cap() &&
witness_plan_spawn_width_is_min_floor_exec_at_runner_cap() &&
witness_plan_spawn_width_is_floor_width_at_runner_cap() &&
witness_floor_derived_width_leaves_headroom_at_cap()
}
13 changes: 4 additions & 9 deletions src/v2/workflow/ci_floor_plan.dag
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import v2.std.node { Atom, Node, TypeNode }
import v2.std.text { String }
import std.types { ContentHash, Int }
import std.measure { HardwareThreadCount, hardware_thread_count, hardware_thread_count_value, byte_size, ByteSize, byte_size_count }
import std.realization_width { width_fold_objective_goals, bounded_host_spawn_width, int_min }
import std.realization_width { width_fold_objective_goals, bounded_host_spawn_width }
import gunbc.fleet_container {
ResourceEnvelope,
parallel_run_demand_envelope,
Expand Down Expand Up @@ -476,11 +476,7 @@ fn gunbc_ci_floor_spawn_width_from_tree() -> HardwareThreadCount {
}

fn gunbc_ci_plan_spawn_width(memory_budget_bytes: Int) -> HardwareThreadCount {
let floor_w = hardware_thread_count_value(
t: gunbc_ci_floor_spawn_width_for_budget(memory_budget: byte_size(memory_budget_bytes))
)
let exec_w = execution_corpus_spawn_width()
hardware_thread_count(count: int_min(a: floor_w, b: exec_w))
gunbc_ci_floor_spawn_width_for_budget(memory_budget: byte_size(memory_budget_bytes))
}

fn gunbc_ci_floor_run_envelope(memory_budget_bytes: Int) -> ResourceEnvelope {
Expand Down Expand Up @@ -599,14 +595,13 @@ fn witness_execution_corpus_spawn_width_at_runner_cap() -> Bool {
execution_corpus_spawn_width() == 3
}

fn witness_plan_spawn_width_is_min_floor_exec_at_runner_cap() -> Bool {
fn witness_plan_spawn_width_is_floor_width_at_runner_cap() -> Bool {
let cap_budget = byte_size_count(b: gunbc_ci_runner_cgroup_memory_cap)
let plan_w = hardware_thread_count_value(t: gunbc_ci_plan_spawn_width(memory_budget_bytes: cap_budget))
let floor_w = hardware_thread_count_value(
t: gunbc_ci_floor_spawn_width_for_budget(memory_budget: gunbc_ci_runner_cgroup_memory_cap)
)
let exec_w = execution_corpus_spawn_width()
plan_w == int_min(a: floor_w, b: exec_w)
plan_w == floor_w
}

fn witness_floor_derived_width_leaves_headroom_at_cap() -> Bool {
Expand Down
Loading