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
16 changes: 10 additions & 6 deletions dsl/gunbc/ci_fleet.dag
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ fn gunbc_ci_runner_spec() -> RunnerSpec {
runner_spec_from_offer(offer: gunbc_ci_fleet_offer)
}

// Phase 1: corpus as IndependentShards WorkDemand (degenerate shard_count=1 today).
fn gunbc_ci_floor_corpus_work_demand() -> WorkDemand {
// Corpus parallel breadth is the CALLER's fact: the floor plan derives it from the
// single-authority spec (gates + corpus cardinality), so it is NOT a tuned constant.
// This keeps the §3 split honest — demand = the work (floor plan), supply = the fleet.
fn gunbc_ci_floor_corpus_work_demand(corpus_shard_count: Int) -> WorkDemand {
WorkDemand {
resources: ResourceEnvelope {
cpu: none,
Expand All @@ -105,7 +107,7 @@ fn gunbc_ci_floor_corpus_work_demand() -> WorkDemand {
os: none,
isolation: IsolationRequirement { boundary: PerJobFilesystem },
toolchains: [],
parallelism: IndependentShards { shard_count: 1 },
parallelism: IndependentShards { shard_count: corpus_shard_count },
data_locality: [],
effects: [],
}
Expand All @@ -115,11 +117,13 @@ fn gunbc_ci_floor_placement_supply() -> PlacementSupplyRow? {
offer_placement_supply_row(offer: gunbc_ci_fleet_offer)
}

// Host spawn-width authority for the CI fleet offer + corpus WorkDemand.
fn ci_fleet_floor_spawn_width() -> HardwareThreadCount {
// Host spawn-width = min(caller's corpus breadth, this fleet's hardware threads).
// No hand-tuned width: add a gate to the spec → breadth re-derives; change the host →
// supply re-derives; spawn_width follows from both with zero edits here.
fn ci_fleet_floor_spawn_width(corpus_shard_count: Int) -> HardwareThreadCount {
match gunbc_ci_floor_placement_supply() {
Absent => hardware_thread_count(1)
Present { value: row } =>
placement_spawn_width(supply: row, demand: gunbc_ci_floor_corpus_work_demand())
placement_spawn_width(supply: row, demand: gunbc_ci_floor_corpus_work_demand(corpus_shard_count: corpus_shard_count))
}
}
10 changes: 3 additions & 7 deletions src/v2/extdeps/languages/bash.dag
Original file line number Diff line number Diff line change
Expand Up @@ -1089,13 +1089,9 @@ fn bash_exit_code_1_quoted_wrong_translation_rules_node() -> Node {
}

fn bash_exit_code_lex() -> LexRules {
ModeledLexRules {
root: LexRuleSet {
rules: [
bash_lex_rule(token_class: ^bash_token_kw_exit, text: "exit ")
]
}
}
phrase_to_lex_rules(p: phrase([
span(text: "exit ", class: ^bash_token_kw_exit)
]))
}

fn bash_exit_code_1_target_model() -> TargetModel {
Expand Down
22 changes: 20 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 @@ -14,8 +14,10 @@ import std.realization {
Runnable, RunnableSingleClaim, RunnableDiscoveryBatch,
}
import v2.workflow.ci_floor_plan {
gunbc_ci_floor_batches, corpus_runnable
gunbc_ci_floor_batches, corpus_runnable,
gunbc_ci_floor_breadth, gunbc_ci_floor_spawn_width
}
import std.measure { hardware_thread_count_value }
import gunbc.ci_layer_roots { witness_discovery_scan_dirs, witness_layer_roots }
import v2.std.algebra { length, list_snoc_item }
import v2.std.collection { List }
Expand Down Expand Up @@ -100,6 +102,20 @@ fn witness_corpus_skip_node_frontier_enabled() -> Bool {
}
}

// Connected relationship: spawn_width is DERIVED from the floor breadth, not tuned.
// When breadth <= hardware threads (true on the real fleet), spawn_width == breadth —
// so the host runs the independent layer concurrently, not one-at-a-time.
fn witness_spawn_width_tracks_breadth() -> Bool {
hardware_thread_count_value(t: gunbc_ci_floor_spawn_width()) == gunbc_ci_floor_breadth()
}

// Discriminating: the floor is NOT serial. A revert to a constant shard_count (=1) or a
// supply that collapsed to one thread makes breadth/width 1 → this goes RED.
fn witness_floor_not_serial() -> Bool {
(gunbc_ci_floor_breadth() > 1) &&
(hardware_thread_count_value(t: gunbc_ci_floor_spawn_width()) > 1)
}

test fn ci_floor_plan_witnesses() -> Bool {
witness_two_readiness_layers() &&
witness_compile_root_runs_first() &&
Expand All @@ -108,5 +124,7 @@ test fn ci_floor_plan_witnesses() -> Bool {
witness_discovery_scan_dirs_in_plan() &&
witness_scan_dirs_match_layer_authority() &&
witness_corpus_has_no_explicit_entries() &&
witness_corpus_skip_node_frontier_enabled()
witness_corpus_skip_node_frontier_enabled() &&
witness_spawn_width_tracks_breadth() &&
witness_floor_not_serial()
}
14 changes: 11 additions & 3 deletions src/v2/workflow/ci_floor_plan.dag
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import gunbc.ci_spec {
Gate, RustMonolithGate, EmitHostGate, LayeringImportsGate, ResolvedImportsGate, DslCompileCleanGate, CiYamlGate,
SourceRootIngestGate
}
import v2.std.algebra { list_snoc_item }
import v2.std.algebra { length, list_snoc_item }
import v2.std.collection { List }
import v2.std.dependency { DataDependsOn, DependencyView }
import v2.std.node { Atom, Node, TypeNode }
Expand Down Expand Up @@ -215,7 +215,15 @@ fn gunbc_ci_floor_schedule_lens_holds() -> Bool {
}
}

// claim_executor spawn-width companion (feature:scheduler-width-budget scaffold).
// Floor breadth = the count of independent floor units (one per spec gate; the corpus
// node rides the same later layer), DERIVED from the single-authority spec — never a
// tuned constant. Add a gate to gunbc_ci_spec → breadth re-derives here automatically.
fn gunbc_ci_floor_breadth() -> Int {
length(xs: gunbc_ci_spec.gates)
}

// claim_executor spawn-width companion: min(floor breadth, fleet hardware threads).
// The relationship is the model; nothing here is hand-tuned per host or per gate.
fn gunbc_ci_floor_spawn_width() -> HardwareThreadCount {
ci_fleet_floor_spawn_width()
ci_fleet_floor_spawn_width(corpus_shard_count: gunbc_ci_floor_breadth())
}
Loading