Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f747547
Linear code-point/octet slice: skip/take/get/count share the RRB carr…
Oct 4, 2026
08a22a6
code_point_slice witness: offset decode over non-ASCII text through t…
Oct 4, 2026
6df2f1b
Regenerate stage0 mirrors (pass 1); witness imports
Oct 5, 2026
fe80952
Regenerate stage0 mirrors (pass 2): emitted skip/take/skip-first now …
Oct 5, 2026
abcf580
Value drop: release a persistent carrier by refcount below a nesting …
Oct 5, 2026
aa8bf65
Cite the deep-drop control by its module
Oct 5, 2026
e8bfb93
Merge origin/main (conflicted generated mirrors taken from main; rege…
Oct 5, 2026
80b9ffc
Regenerate stage0 mirrors on the merged tree (required-regen converge…
Oct 5, 2026
04cd308
Restate the slice cost as O(n log n); exact negative-count contracts;…
Oct 5, 2026
6ece848
Regenerate witnesses.yml: slice cost controls step on the generated job
Oct 5, 2026
be51a9f
Enrol only the drop tests of value_depth_walker_tests beside the slic…
Oct 5, 2026
ddb5b64
code_point_slice witness: size the many-fields walk under the new-wit…
Oct 5, 2026
f70eb02
Merge origin/main (conflicted generated artifacts taken from main; re…
Oct 5, 2026
e68e82d
skip/take contracts: ephemeral_work from the same clamped k as output…
Oct 5, 2026
91f195d
Regenerate stage0 mirrors and witnesses.yml on the merged tree (requi…
Oct 5, 2026
26db7bc
Merge origin/main (conflicted generated artifacts taken from main; re…
Oct 5, 2026
09bf927
Regenerate stage0 mirrors and witnesses.yml on the merged tree (requi…
Oct 5, 2026
457c439
Merge origin/main: keep main's PortableValue drop beside the carrier …
Oct 5, 2026
3cc369f
v1_rt.rs: restore list_skip/list_take (main's mirror lacked the runti…
Oct 5, 2026
c10f939
Regenerate stage0 mirrors on the merged tree (pass 1; v1_rt.rs kept a…
Oct 5, 2026
34306c6
Regenerate stage0 mirrors on the merged tree (pass 2; required-regen …
Oct 5, 2026
3074790
Merge remote-tracking branch 'origin/main' into session/swift-ibex-835
Oct 6, 2026
5d3205b
repo_self_build: the targeted-test comment no longer calls the unit l…
Oct 6, 2026
0481d0b
Regenerate compiler_tests.rs on the merged tree (required-regen conve…
Oct 6, 2026
654117b
Merge origin/main (generated conflicts taken from main; v1_rt.rs keep…
Oct 7, 2026
aded760
Regenerate stage0 mirrors and witnesses.yml on the merged tree (requi…
Oct 7, 2026
76052f4
Merge origin/main incl. #13280 (generated conflicts taken from main; …
Oct 8, 2026
931fc9a
Regenerate stage0 mirrors and witnesses.yml on main incl. #13280 (ext…
Oct 8, 2026
2cfffd6
Merge origin/main (generated conflicts taken from main; regen follows)
Oct 9, 2026
e551ac2
Regenerate stage0 mirrors and witnesses.yml on current main (incl. v1…
Oct 9, 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
25 changes: 25 additions & 0 deletions .github/workflows/witnesses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,31 @@ jobs:
if (! '[' '-f' "$GUNBC_FLOOR_RECEIPT" ']') || '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' || ('[' "$GUNBC_FLOOR_CLASS" '=' 'infra' ']' && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=structural' "$GUNBC_FLOOR_RECEIPT"))) || ('[' "$GUNBC_FLOOR_CLASS" '=' 'none' ']' && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=structural' "$GUNBC_FLOOR_RECEIPT")) && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=infra' "$GUNBC_FLOOR_RECEIPT"))); then 'printf' 'class=%s\nsignature=%s\nexit=%s\n' "$GUNBC_FLOOR_CLASS" "$GUNBC_FLOOR_SIGNATURE" "$GUNBC_FLOOR_EXIT" > "$GUNBC_FLOOR_RECEIPT"; if '[' "$GUNBC_FLOOR_CLASS" '=' 'infra' ']'; then 'echo' '::error title=environment::floor_class='"$GUNBC_FLOOR_CLASS"' signature='"$GUNBC_FLOOR_SIGNATURE"' exit='"$GUNBC_FLOOR_EXIT"'; this is not a verdict about the diff. Attempt receipt: '"$GUNBC_FLOOR_RECEIPT"; fi; if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']'; then 'echo' '::error title=subject::floor_class='"$GUNBC_FLOOR_CLASS"' exit='"$GUNBC_FLOOR_EXIT"'; read the step log for the subject defect'; fi; fi
'exit' "$GUNBC_FLOOR_EXIT"

if: "!cancelled()"
- name: Run the slice cost controls
id: slice_cost_controls
run: |+
GUNBC_FLOOR_LOG='gunbc-floor-cmd.log'
'set' '+e'
'set' '-o' 'pipefail'
('sh' '-e' '-c' 'cargo test --release -p v1-stage0-runtime --lib -- list_slice_tests') 2>&1 | 'tee' "$GUNBC_FLOOR_LOG"
GUNBC_FLOOR_EXIT="$?"
GUNBC_FLOOR_RECEIPT='gunbc-floor-outcome.txt'
GUNBC_FLOOR_CLASS='structural'
GUNBC_FLOOR_SIGNATURE=''
if '[' "$GUNBC_FLOOR_EXIT" '-eq' '126' ']'; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='CommandInvokedCannotExecute'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' "$GUNBC_FLOOR_EXIT" '-eq' '127' ']'; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='CommandNotFound'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' "$GUNBC_FLOOR_EXIT" '-eq' '0' ']'; then GUNBC_FLOOR_CLASS='none'; GUNBC_FLOOR_SIGNATURE=''; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'MemoryStallRefusedPageThrash' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='MemoryStallRefusedPageThrash'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'The runner has received a shutdown signal' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='RunnerLost'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'sccache: error: failed to execute compile' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='SccacheFailedToExecuteCompile'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' '(exit status: 254)' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='SccacheRustcWrapperExit254'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'sccache: encountered fatal error' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='SccacheFatalError'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'failed to spawn' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='ProcessSpawnFailure'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'Resource temporarily unavailable' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='ResourceTemporarilyUnavailable'; fi
if (! '[' '-f' "$GUNBC_FLOOR_RECEIPT" ']') || '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' || ('[' "$GUNBC_FLOOR_CLASS" '=' 'infra' ']' && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=structural' "$GUNBC_FLOOR_RECEIPT"))) || ('[' "$GUNBC_FLOOR_CLASS" '=' 'none' ']' && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=structural' "$GUNBC_FLOOR_RECEIPT")) && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=infra' "$GUNBC_FLOOR_RECEIPT"))); then 'printf' 'class=%s\nsignature=%s\nexit=%s\n' "$GUNBC_FLOOR_CLASS" "$GUNBC_FLOOR_SIGNATURE" "$GUNBC_FLOOR_EXIT" > "$GUNBC_FLOOR_RECEIPT"; if '[' "$GUNBC_FLOOR_CLASS" '=' 'infra' ']'; then 'echo' '::error title=environment::floor_class='"$GUNBC_FLOOR_CLASS"' signature='"$GUNBC_FLOOR_SIGNATURE"' exit='"$GUNBC_FLOOR_EXIT"'; this is not a verdict about the diff. Attempt receipt: '"$GUNBC_FLOOR_RECEIPT"; fi; if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']'; then 'echo' '::error title=subject::floor_class='"$GUNBC_FLOOR_CLASS"' exit='"$GUNBC_FLOOR_EXIT"'; read the step log for the subject defect'; fi; fi
'exit' "$GUNBC_FLOOR_EXIT"

if: "!cancelled()"
- name: "Stage0 mirrors match one emission by this seed: required CI build lane"
id: stage0_regen
Expand Down
4 changes: 2 additions & 2 deletions dag/extdeps/languages/rust/emit.dag
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ data rust_simple_method_specs: List<SimpleMethodSpec> = [
{ method_name: "first", template: "\{recv\}.first().cloned()", wraps_result: false },
{ method_name: "enumerate", template: "\{recv\}.iter().cloned().enumerate().map(|(i, v)| (i as i64, v)).collect::<Vec<_>>()", wraps_result: true },
{ method_name: "chars", template: "\{recv\}.chars().map(|c| c as i64).collect::<Vec<_>>()", wraps_result: true },
{ method_name: "skip", template: "\{recv\}.iter().cloned().skip(\{arg\} as usize).collect::<Vec<_>>()", wraps_result: true },
{ method_name: "take", template: "\{recv\}.iter().cloned().take(\{arg\} as usize).collect::<Vec<_>>()", wraps_result: true },
{ method_name: "skip", template: "v1_rt::list_skip(&\{recv\}, \{arg\})", wraps_result: true },
{ method_name: "take", template: "v1_rt::list_take(&\{recv\}, \{arg\})", wraps_result: true },
{ method_name: "is_empty", template: "\{recv\}.is_empty()", wraps_result: false }
]

Expand Down
24 changes: 24 additions & 0 deletions dag/gunbc/repo/repo_self_build.dag
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,30 @@ fn repo_self_test_command() -> String {
)
}

// A NAMED SUBSET OF ONE PACKAGE'S UNIT TESTS, for a control in a package the whole-package run above
// does not cover: the blocking rust-unit-tests lane runs repo_self_test_command, which is
// v1-compiler only.
// The filters are libtest's substring filters after `--`; an empty list would run the whole
// package, which is repo_self_test_command's request and not this one.
fn repo_self_targeted_test_command(package: String, filters: List<String>) -> String {
join(concat(["cargo test", repo_self_build_profile_flag, "-p", package, "--lib", "--"], filters), " ")
}

// The crate the emitted runtime v1_rt.rs is compiled in (the stage0 partition's foundation crate).
data repo_self_runtime_package: String = "v1-stage0-runtime"

// THE EMITTED RUNTIME'S SLICE COST CONTROLS, ENROLLED. v1_rt list_slice_tests carries a RED that runs
// the copying skip / take templates the emit table used to render and a GREEN that runs
// list_skip / list_take, on non-ASCII code points, so the pair discriminates the quadratic rather
// than merely exercising the slice. Only this crate is named: the interpreter's slice and drop
// controls (v1_interpreter slice_cost_tests, value_depth_walker_tests) are in v1-compiler's own
// unit tests, which the blocking rust-unit-tests lane already runs whole (repo_self_test_command),
// and running them again here would be the same work twice. v1-stage0-runtime is outside that
// lane's package, so without this step its controls would only compile.
fn repo_self_slice_cost_control_command() -> String {
repo_self_targeted_test_command(package: repo_self_runtime_package, filters: ["list_slice_tests"])
}

// THE LINT PASS OVER EVERY TARGET, as the one invocation DESIGN's "Building & checks" names.
// `--all-targets` is the whole point: the test and example targets outside `--lib` and `--bins`
// are compiled by no build command above and executed by no test command, so before this row
Expand Down
30 changes: 29 additions & 1 deletion dag/gunbc/witness/compiler_gate_workflow.dag
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ import gunbc.fleet_release_bins_key {
release_bins_pack_object_script, release_bins_pack_object_path_expression,
compiler_pair_candidate_artifact_name, compiler_pair_candidate_retention_whole_days,
}
import gunbc.repo_self_build { repo_self_build_command, repo_self_clippy_command, repo_self_test_command }
import gunbc.repo_self_build { repo_self_build_command, repo_self_clippy_command, repo_self_test_command, repo_self_slice_cost_control_command }
import extdeps.exec.command { shell_command_render }
import extdeps.github.expressions { interpolate, ContextAccess, Needs, Github, Expression, default_expression_spellings }
import extdeps.github.log_annotations { emit_line_shell }
Expand Down Expand Up @@ -270,6 +270,28 @@ fn compiler_gate_hosted_build_prelude_bound_steps() -> List<CompilerGateBoundSte
data compiler_gate_clippy_step_name: String = "Lint every target"
data compiler_gate_lint_step_id: String = "lint_all_targets"

// THE EMITTED RUNTIME'S SLICE COST CONTROLS RUN HERE, beside the lint and under the same status
// guard, because the blocking unit-test lane runs v1-compiler only and the runtime crate's controls
// would otherwise only compile: specification without execution (DESIGN section 5). It is a step on
// an existing job, not a job: the roster is closed to growth. Its subject and its RED / GREEN pair
// are gunbc.repo_self_build repo_self_slice_cost_control_command's to state.
data compiler_gate_slice_cost_step_name: String = "Run the slice cost controls"
data compiler_gate_slice_cost_step_id: String = "slice_cost_controls"

fn compiler_gate_slice_cost_step() -> Step {
RunStep {
name: Present { value: compiler_gate_slice_cost_step_name },
id: Present { value: compiler_gate_slice_cost_step_id },
run: concat(wrap_command_with_floor_attempt_receipt(command: repo_self_slice_cost_control_command()), "\n"),
shell: none,
env: none,
working_directory: none,
if_condition: Present { value: witness_step_status_guard_expression() },
continue_on_error: none,
timeout_minutes: none
}
}

fn compiler_gate_lint_step() -> Step {
RunStep {
name: Present { value: compiler_gate_clippy_step_name },
Expand Down Expand Up @@ -856,6 +878,11 @@ fn compiler_gate_generated_bound_steps() -> List<CompilerGateBoundStep> {
role: consumes_only(capabilities: [CargoCapability]),
step_name: compiler_gate_clippy_step_name,
},
CompilerGateBoundStep {
step: compiler_gate_slice_cost_step(),
role: consumes_only(capabilities: [CargoCapability]),
step_name: compiler_gate_slice_cost_step_name,
},
CompilerGateBoundStep {
step: compiler_gate_stage0_regen_step(),
role: consumes_only(capabilities: [RustfmtCapability]),
Expand Down Expand Up @@ -923,6 +950,7 @@ fn compiler_gate_floor_scripts_are_renderable() -> Bool {
wrap_command_is_renderable(command: witness_floor_run_script())
&& wrap_command_is_renderable(command: build_lane_run_script())
&& wrap_command_is_renderable(command: repo_self_clippy_command())
&& wrap_command_is_renderable(command: repo_self_slice_cost_control_command())
&& wrap_command_is_renderable(command: repo_self_build_command(bins: witness_floor_required_bins))
&& required_ci_measurement_scripts_are_renderable()
}
Expand Down
26 changes: 23 additions & 3 deletions dag/std/primitives.dag
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,31 @@ data append_contract: PrimitiveContract = {
carrier_cost: CarrierSensitive { ephemeral_work: "n + m", persistent_work: "log(n + m)" }
}

// SKIP AND TAKE ARE THE SLICE, AND ON THE PERSISTENT CARRIER THEY SHARE THE RECEIVER'S TREE. A walk
// that reads a code-point or octet list by offset slices it as `xs |> skip(n: a) |> take(n: b - a)`;
// when either half copied its result, each slice paid the remainder and the walk was quadratic in
// the list (DESIGN section 6, bare minimum cost). Both realizations hold the list as an RRB vector
// (the interpreter's Value::List, v1_rt's im::Vector), whose split is logarithmic, so the slice
// costs log len to form and only its own length to read. That removes the quadratic remainder
// copying; it does not make an offset walk linear, since every member read is get_contract's
// log n on this carrier, so a walk that reads each offset is O(n log n).
//
// THE COUNT IS CLAMPED, AND A NEGATIVE COUNT IS THE WHOLE LIST. Both realizations take
// k = if n < 0 then len else min(n, len): skip keeps len - k members and take keeps k.
data skip_contract: PrimitiveContract = {
name: "skip",
work: "n",
output_size: "max(0, len - n)",
work: "log len",
output_size: "len - k where k = if n < 0 then len else min(n, len)",
certainty: Proven,
carrier_cost: CarrierInsensitive
carrier_cost: CarrierSensitive { ephemeral_work: "len - k where k = if n < 0 then len else min(n, len)", persistent_work: "log len" }
}

data take_contract: PrimitiveContract = {
name: "take",
work: "log len",
output_size: "k where k = if n < 0 then len else min(n, len)",
certainty: Proven,
carrier_cost: CarrierSensitive { ephemeral_work: "k where k = if n < 0 then len else min(n, len)", persistent_work: "log len" }
}

data zip_contract: PrimitiveContract = {
Expand Down Expand Up @@ -791,6 +810,7 @@ fn primitive_contract_roster() -> List<PrimitiveContract> {
list_push_contract,
append_contract,
skip_contract,
take_contract,
zip_contract,
enumerate_contract,
empty_map_contract,
Expand Down
94 changes: 94 additions & 0 deletions dag/test/claim/code_point_slice_witness_test.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
module test.claim.code_point_slice_witness

import std.algebra { Cons }
import std.coercion { unicode_scalar_unfold, unicode_scalar_fold }
import v2.std.live_tree { LiveTreeDisposition, SubstrateInputsOnly }

data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly

// A BODY READ BY OFFSET, THROUGH THE CODE-POINT SLICE. The text is unfolded to its code points
// once; every later read is one member (`get`), the length (`count`) or a bounded slice
// (`skip` then `take`) folded back to host text. std.primitives get_contract, count_contract,
// skip_contract and take_contract price each of those at log len or better on the persistent
// carrier, so the walk is O(n log n) in the body on every input -- the remainder copying that made
// it quadratic is gone. Host-text char_at / substring are O(offset) per read on non-ASCII text in
// the interpreter and on all text in emitted Rust, which is the quadratic this surface avoids.
// The bodies here are non-ASCII on purpose: that is the input the host-text walk is quadratic on.
//
// The wire shape is the length-prefixed field `<decimal count>:<that many code points>`, repeated.
type CodePointField {
value: String
next: Int
}

fn cps_find(cps: List<Int>, at: Int, stop: Int) -> Int? {
match get(xs: cps, index: at) {
Absent => none
Present { value: c } => if c == stop { Present { value: at } } else { cps_find(cps: cps, at: at + 1, stop: stop) }
}
}

fn cps_slice_text(cps: List<Int>, start: Int, end: Int) -> String {
unicode_scalar_fold(xs: cps |> skip(n: start) |> take(n: end - start))
}

fn cps_field(cps: List<Int>, at: Int) -> CodePointField? {
match cps_find(cps: cps, at: at, stop: code_point(c: ":")) {
Absent => none
Present { value: colon } =>
match parse_int(s: cps_slice_text(cps: cps, start: at, end: colon)) {
Absent => none
Present { value: n } =>
if n < 0 || colon + 1 + n > count(cps) {
none
} else {
Present { value: CodePointField { value: cps_slice_text(cps: cps, start: colon + 1, end: colon + 1 + n), next: colon + 1 + n } }
}
}
}
}

fn cps_fields(cps: List<Int>, at: Int, acc: List<String>) -> List<String>? {
if at == count(cps) {
Present { value: reverse(acc) }
} else {
match cps_field(cps: cps, at: at) {
Absent => none
Present { value: f } => cps_fields(cps: cps, at: f.next, acc: Cons { head: f.value, tail: acc })
}
}
}

fn decode_fields(body: String) -> List<String>? {
cps_fields(cps: unicode_scalar_unfold(s: body), at: 0, acc: [])
}

// The body doubled `times` times: linear to build, so the measured walk is the only quadratic
// candidate in the claim.
fn doubled(s: String, times: Int) -> String {
if times <= 0 { s } else { doubled(s: concat(s, s), times: times - 1) }
}

// POSITIVE CONTROL: the slice reads the right code points, including astral ones (one code point,
// four UTF-8 bytes) and a field whose length prefix is two digits.
test fn code_point_slice_decodes_non_ascii_fields() -> Bool {
decode_fields(body: "2:\u{e9}\u{4e2d}3:\u{1f600}ab0:12:\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}") == Present { value: ["\u{e9}\u{4e2d}", "\u{1f600}ab", "", "\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}\u{e9}"] }
}

// A length prefix that runs past the body is refused, not truncated.
test fn code_point_slice_refuses_an_overlong_field() -> Bool {
decode_fields(body: "4:\u{e9}\u{4e2d}") == none
}

// THE WALK OVER MANY FIELDS: 512 non-ASCII fields, 3,072 code points, sized under the floor's
// new-witness eval-step budget (v2.workflow.required_floor). This claim's subject is that the
// decode stays correct field after field; the COST of the walk is not measured here, because eval
// steps cannot see a host-level copy. The cost controls that can, RED on the copying forms and
// GREEN on the sharing ones, are gunbc.repo_self_build repo_self_slice_cost_control_command, run on
// the merge path by the generated job's slice cost step.
test fn code_point_slice_walk_is_correct_at_scale() -> Bool {
match decode_fields(body: doubled(s: "3:\u{e9}\u{4e2d}\u{1f600}", times: 9)) {
Absent => false
Present { value: fs } => count(fs) == 512 && fs |> all(f => f == "\u{e9}\u{4e2d}\u{1f600}")
}
}
2 changes: 1 addition & 1 deletion src/v1/05_emit_rust.dag
Original file line number Diff line number Diff line change
Expand Up @@ -13565,7 +13565,7 @@ fn emit_rust_first_method_call(receiver: Node, registry: Map<String, ItemInfo>,
let skip_args = method_arg_nodes(texpr: receiver)
let recv_str = emit_typed_expr(texpr: skip_recv, registry: registry, scope: scope, depth: depth, shared_types: shared_types, emit_info: emit_info, fuel: 1024)
let n_str = emit_typed_first_arg(args: skip_args, registry: registry, scope: scope, depth: depth, shared_types: shared_types, emit_info: emit_info)
concat(recv_str, ".iter().cloned().skip(", n_str, " as usize).next()")
concat(recv_str, ".get((", n_str, ") as usize).cloned()")
} else {
let recv_str = emit_typed_expr(texpr: receiver, registry: registry, scope: scope, depth: depth, shared_types: shared_types, emit_info: emit_info, fuel: 1024)
concat(recv_str, ".first().cloned()")
Expand Down
Loading
Loading