Skip to content

Check weighted sidecar arithmetic - #102

Closed
MesTTo wants to merge 4 commits into
trueagi-io:mainfrom
MesTTo:pr/mork-weighted-arithmetic-guards
Closed

Check weighted sidecar arithmetic#102
MesTTo wants to merge 4 commits into
trueagi-io:mainfrom
MesTTo:pr/mork-weighted-arithmetic-guards

Conversation

@MesTTo

@MesTTo MesTTo commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Adds checked arithmetic to the weighted path sidecar.

set_weight, apply_delta, selection_tree, and select_by_offset_tree now report typed arithmetic errors instead of saturating or silently publishing an incorrect positive-weight total. The tests cover signed delta overflow, total positive-weight overflow, and no-mutation behavior on rejected updates.

Depends on #101.

Validation:

  • CARGO_HOME=/home/user/Dev/.cargo-isolated RUSTFLAGS='-C target-cpu=native -Awarnings' cargo +nightly test -p mork --lib
  • CARGO_HOME=/home/user/Dev/.cargo-isolated RUSTFLAGS='-C target-cpu=native -Awarnings' cargo +nightly test -p mork --tests
  • rustfmt --check kernel/src/weighted_paths.rs kernel/tests/public_api.rs kernel/tests/weighted_paths.rs
  • jscpd --reporters ai --min-lines 5 --min-tokens 50 kernel/src/weighted_paths.rs kernel/tests/public_api.rs kernel/tests/weighted_paths.rs
  • git diff --check

@MesTTo

MesTTo commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #101: this re-lands the whole weighted_paths.rs to switch saturating->checked arithmetic (~83% shared lines). Folding the checked arithmetic into #101 instead, so it lands as one PR checked-from-the-start.

@MesTTo MesTTo closed this Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant