Skip to content

quest: plan NonZero's unchecked arithmetic - #629

Merged
kixelated merged 1 commit into
mainfrom
quest-plan/nonzero-unchecked-ops
Nov 7, 2026
Merged

kixelated merged 1 commit into
mainfrom
quest-plan/nonzero-unchecked-ops

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Plans NonZero::unchecked_add and NonZero::unchecked_mul as an XS quest in m3's ts-unsafe epic. moq-dev/rust2#622 translates the integers' unchecked_* and leaves these two refused by name.

Both are unstable (nonzero_ops) and not #[track_caller], so the plan says a violated precondition aborts at std's site, through caller.rs's SITES, rather than at the call.

Decided with the maintainer on 2026-11-07: m3, in this epic. No consumer at the moq pin.

Validation: quest check passes (51 documents).

(Written by Claude Opus 5.5 with high effort)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pullfrog

pullfrog Bot commented Nov 7, 2026

Copy link
Copy Markdown

Pullfrog  | Review this ➔

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head 28219a6 against base 2b10b3a.

No actionable findings in this two-file planning-only change. The new quest is linked from the unsafe epic and scopes the remaining NonZero operations separately. In the inspected Rust source, unchecked_add and unchecked_mul are nonzero_ops methods without track_caller and delegate to the primitive unchecked arithmetic, consistent with the plan to use a std source location rather than the consumer call site.

Direction: when implementing, pin valid boundary results and the configured native precondition-abort text/location in differential tests, including signed multiplication overflow and the supported unsigned addition widths. Invalid unsafe inputs are not guaranteed to abort in every Rust build configuration; match the project's pinned validation configuration rather than treating that behavior as a universal Rust guarantee.

Limits: GitHub-only static review of the complete diff, caller-site infrastructure and Rust source. No translator changes land here. I did not run quest validation, compilation, differential tests or native abort cases, and did not verify the claimed absence of consumers at the moq pin. This COMMENT is not merge approval.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds a required item for translating NonZero::unchecked_add and NonZero::unchecked_mul. It also adds a planning document that records existing translation behavior, abort-location details, scope, and the translator output as the public API.

Merge Risk: Minimal · up to 28219

This documentation-only change presents no identified merge-blocking risk and is ready to merge after normal checks.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title "quest: plan NonZero's unchecked arithmetic" matches the main change. The PR adds a planning document for translating NonZero::unchecked_add and NonZero::unchecked_mul, and links it to the m…
Description check Passed The description states that the PR plans NonZero::unchecked_add and NonZero::unchecked_mul as an XS quest in the m3 ts-unsafe epic. It explains that both methods are unstable and not #[track_caller], …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "quest: plan NonZero's unchecked arithmetic" matches the main change. The PR adds a planning document for translating NonZero::unchecked_add and NonZero::unchecked_mul, and links it to the m3 ts-unsafe epic. The title is short and specific, and it names the subject and the nature of the change (a plan).

Full details: Description check

Explanation

The description states that the PR plans NonZero::unchecked_add and NonZero::unchecked_mul as an XS quest in the m3 ts-unsafe epic. It explains that both methods are unstable and not #[track_caller], so a violated precondition aborts at std's site through caller.rs's SITES. It also records the maintainer decision and the validation result. It matches the changeset closely.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 95f17be1-1f41-40f1-97a3-66efa9187585
Commits

Reviewing files that changed from the base of the PR and between 2b10b3a and 28219a6.

Files selected for processing: 2

  • quest/m3/ts-unsafe/README.md
  • quest/m3/ts-unsafe/nonzero-unchecked-ops.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@kixelated
kixelated added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 3ce3eb4 Nov 7, 2026
4 checks passed
@kixelated
kixelated deleted the quest-plan/nonzero-unchecked-ops branch November 7, 2026 04:47
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