Skip to content

t27o: pay down the duplicate bodies of the A2 methods -- slice contains is bytes_contain for u8 only, saturating_add_u64 on checked_add_u64 (Closes #10764) - #10817

Merged
gHashTag merged 1 commit into
masterfrom
t27o/std-methods-dedup-10764
Oct 19, 2026
Merged

gHashTag merged 1 commit into
masterfrom
t27o/std-methods-dedup-10764

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Follow-up to #10801. That PR was squash-merged at its pre-fix head (11b672a) at 03:22:44Z, after auto-merge was enabled and before the dedup fix at 05b4785 reached it, so master (72f1280) carries the two duplicate groups tools/dupe_scan.py names: "a body written under bytes_contain is now copied [11] time(s)" and "a body written under saturating_add is now copied [2] time(s)". This PR is that fix commit on top of master, unchanged. Closes #10764.

  • contains_u16 .. contains_f64 (ten fns, the body of bytes_contain once types are normalised) and their ten tests are deleted. A slice contains converts only on a u8 element, through bytes_contain; any other scalar element type is refused with its own reason: "slice contains on u32 at line N: no generic helper, and per-type copies are refused by the DRY ratchet" (R_SLICEGEN). Negative controls pin it on a [u32], a Vec<u16> and a [f64]; the slice-of-texts control stays. str_contains_char duplicates nothing and stays.
  • saturating_add_u64 was byte-identical to hosting::panel's saturating_add; it is built on checked_add_u64 now. No other saturating_* fn was in a group.

Checks, run on this branch: python3 -I tools/dupe_scan.py exit 0, "duplicate bodies: 713 of 13911 in 203 group(s) across 2375 spec(s)", "ok: no new duplicate body, and none of the known groups grew"; --like specs/tools/t27o/rust_std.t27: nothing in this file is written elsewhere; the ledger is not blessed. t27b test 51 passed (rust_std) and 129 passed (rust_convert); t27c test-report vacuous passes 0 of 51 and 0 of 129 (run on the identical content before the cherry-pick); t27c coverage specs/tools/t27o/rust_std.t27 149 of 149; both seals --verify match; the gen file is byte-identical to t27c gen-rust of the spec; cargo check -p tri clean; check_devhome_paths.py OK.

Corrected measure (tri from this content, master tri b94c869; method first refusals before -> after): count_ones 8 -> 6, trailing_zeros 1 -> 0, leading_zeros 3 -> 2, pow 8 -> 0, saturating_add 21 -> 9, saturating_sub 29 -> 5, saturating_mul 2 -> 1, div_ceil 12 -> 7, sqrt 49 -> 3, ln 14 -> 0 (14 in the libm kind), is_finite 12 -> 2, to_bits 12 -> 5, is_ascii 12 -> 1, unwrap_or 14 -> 8, get 68 -> 67, contains 124 -> 120 (+7 in the new slice-contains kind); all methods 3207 -> 3078. Converted fns 1830 -> 1889, converted tests 648 -> 668, no file converts fewer.

Auto-merge is not enabled on this PR.

🤖 Generated with Claude Code

…ns is bytes_contain for u8 only, saturating_add_u64 is built on checked_add_u64 (Closes #10764)

tools/dupe_scan.py named two new groups on #10801. Both are gone:

- contains_u16 .. contains_f64 (ten fns, the body of bytes_contain once the
  types are normalised; t27 has no generics to share it) and their ten tests
  are deleted. A slice `contains` converts only when the element type is u8,
  through bytes_contain. Any other scalar element type is refused with a
  reason of its own, R_SLICEGEN: "slice contains on `u32` at line N: no
  generic helper, and per-type copies are refused by the DRY ratchet". The
  std table loses the per-type row; a negative control pins the refusal on a
  u32 slice, a Vec<u16> and an f64 slice, and the slice-of-texts control stays.
  str_contains_char duplicates nothing and stays.
- saturating_add_u64 was byte-identical to hosting::panel's saturating_add.
  It is built on this module's checked_add_u64 now (a `use` of panel splices
  28 modules and clashes with toolchain's starts_with / ends_with). The
  other saturating_* fns were not in any group.

dupe_scan: "duplicate bodies: 682 of 13593 in 195 group(s)", ok, no new group
and none grew; `--like specs/tools/t27o/rust_std.t27`: nothing in this file is
written elsewhere. The ledger was not blessed. Tests: t27b 51 / 51 and 129 /
129, test-report vacuous 0 of 51 and 0 of 129, coverage of rust_std.t27 149 of
149, both seals re-saved and verified.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gHashTag

Copy link
Copy Markdown
Owner Author

Review (orchestrator, Opus): this pays down the duplicate bodies that #10801 brought to master (it merged at its old head; its auto-merge had been switched off for exactly this and was switched back on at 03:21:53Z from the shared account, not by this loop).

Re-ran on 9aaa635: python3 -I tools/dupe_scan.py -> ok: no new duplicate body, and none of the known groups grew (713 of 13911 in 203 groups; the bytes_contain x11 and saturating_add x2 groups are gone, ledger not blessed); --like specs/tools/t27o/rust_std.t27 -> nothing written elsewhere; t27b test rust_std 51/51 and rust_convert 129/129; t27c coverage rust_std 149/149; both seals MATCH; t27c gen-rust byte-identical to the committed gen file. Net -208 lines. Converted on the five repositories after the fix: 1,830 -> 1,889 (+59; the per-type contains gave the other 6). Auto-merge on.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-19 04:02:57 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 39
PRs with All Checks Green 11
READY 2
FAILING 39
PENDING 0
NO CHECKS YET 0

These columns do not partition: 2 + 39 + 0 + 0 = 41, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=03f3de4a3582 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants