diff --git a/bootstrap/src/compiler.rs b/bootstrap/src/compiler.rs index 151f0b4405..57939f7c58 100644 --- a/bootstrap/src/compiler.rs +++ b/bootstrap/src/compiler.rs @@ -12307,14 +12307,15 @@ impl VerilogCodegen { } } + // NO CALL SITE is not a defect. An array parameter that cannot + // be bound to a module-level array is simply passed BY VALUE: + // it stays a real `input [W-1:0]` and the body indexes it by + // element slice (#1745). Refusing instead skipped the whole + // function, which is how specs/ternary/bitnet_layer came to + // print "function on_comb has array parameter(s) but no call + // site" four lines above `assign result = on_comb(...)` -- the + // emitter wrote the call and then denied it. t27#2743. if call_sites.is_empty() { - errors.insert( - f.name.clone(), - format!( - "function {} has array parameter(s) but no call site", - f.name - ), - ); continue; } @@ -12337,26 +12338,21 @@ impl VerilogCodegen { } let unique: std::collections::HashSet = arg_names.iter().cloned().collect(); + // CONFLICTING call sites are not a defect either: one + // function used with two different arrays -- `neuronN(acts, + // w0, ..)` and `neuronN(acts, w1, ..)` -- cannot be + // specialised to one name, so it takes the by-value path + // like any other unbindable parameter. if unique.len() != 1 { - errors.insert( - f.name.clone(), - format!( - "function {} array parameter {} has conflicting call-site arguments", - f.name, pname - ), - ); broken = true; break; } let bound = arg_names.into_iter().next().unwrap(); + // An argument that is not a plain identifier -- an + // expression, or absent -- names no module array to bind + // to. Third form of the same situation, and the same + // answer: pass the array by value. if bound == "W458_NON_ID" || bound == "W458_MISSING" { - errors.insert( - f.name.clone(), - format!( - "function {} array parameter {} must be passed a module-level array identifier", - f.name, pname - ), - ); broken = true; break; } diff --git a/bootstrap/stage0/FROZEN_HASH b/bootstrap/stage0/FROZEN_HASH index a9f55f3a82..39160fa8a6 100644 --- a/bootstrap/stage0/FROZEN_HASH +++ b/bootstrap/stage0/FROZEN_HASH @@ -1 +1 @@ -9e344df23322451ff7ddb46380cab671eb47e77b4a7008f687adfb021675e7aa +25a9c40dc2737fdefdba078a3ac7f25e67e214d4098af477a504287e6415045f diff --git a/docs/now/2026-08-28-an-array-parameter-that-cannot-be-bound-is-passed-by-value.md b/docs/now/2026-08-28-an-array-parameter-that-cannot-be-bound-is-passed-by-value.md new file mode 100644 index 0000000000..bfae063dad --- /dev/null +++ b/docs/now/2026-08-28-an-array-parameter-that-cannot-be-bound-is-passed-by-value.md @@ -0,0 +1,8 @@ +# NOW -- An array parameter that cannot be bound is passed by value (2026-08-28) + +## An array parameter that cannot be bound is passed by value (Closes #2743) + +- three refusals deleted: no call site, disagreeing call sites, non-identifier argument -- none of them a defect +- whole suite with --no-fail-fast: 2419 passed 5 failed -> 2424 passed 0 failed, no test file touched +- earlier 1786/1 figures were from runs that stop at the first failing binary; four of the five failures had never been printed +- blast radius 10 of 650 specs, all one direction: 19 refusals removed, 19 functions gained