Signed addition is refused with the unsigned-overflow diagnostic, even when bounded
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Start with tests/unsigned_addition.rs and the compile_to_core path used by tests/compiler_spine.rs; the issue says the existing tests cover only U32 and U64. Check how signed addition is classified and how the overflow diagnostic is selected. Done means signed bounded addition is either accepted with sufficient proof or refused with a diagnostic that accurately describes the unsupported case.
Written by the indexing model from the issue text.
Description
What happens
I64 + I64 is refused at Core with "unsigned addition requires a dominating proof of no overflow". That happens even when the intent has the where bounds that make the same expression compile for U64. The message points to a fix that doesn't exist for signed operands.
Reproduction (origin/main 980c3ae3, compile_to_core with the pure_context() from tests/compiler_spine.rs)
package a.b@1;
type Input = { a: I64, b: I64, };
type Output = { value: I64, };
intent t(input: Input) returns Output
profile p.read basis none budget <= p.tiny
where input.a <= 100 && input.b <= 100 {
let value: I64 = input.a + input.b;
return { value };
}
| Width | where a <= 100 && b <= 100 |
Result |
|---|---|---|
U64 |
yes | CORE-OK |
I64 |
yes | UnsupportedSourceShape: "unsigned addition requires a dominating proof of no overflow" |
I64 |
no | the same message |
I64 multiplication and negation are refused as "outside the initial lowerable subset", which is accurate. Signed addition is the odd one out: it gets the unsigned-proof diagnostic.
Expected
Either signed addition should be accepted with a sufficient proof, or it should be refused the way multiplication and negation are, with a message that doesn't name a proof the author can't supply. The tests in tests/unsigned_addition.rs cover only U32 and U64.
Related observation (question, not necessarily a bug)
A body require input.a <= 100u64 else ...; placed before the addition does not count as the "dominating proof". Only the header where clause does. If that is intended (where is the precondition and require is a runtime obstruction), the diagnostic could say "add a where bound", because a body guard that does dominate the expression is easy to read as satisfying the message.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from flyingrobots/edict
-
Update Wasmtime to 48.0.11 for RUSTSEC-2026-0648Possibly taken @flyingrobots claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
flyingrobots/edict#457 ·
-
enhancement type: goalpost
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
flyingrobots/edict#355 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
flyingrobots/edict#306 ·
-
enhancement type: goalpost
Difficulty 4/5 3-5 days Newbie friendliness 42/100
flyingrobots/edict#451 ·
-
enhancement release:target-ir
Difficulty 5/5 Over a week Newbie friendliness 28/100
flyingrobots/edict#450 · 1 comment · 1 reaction ·
All issues in flyingrobots/edict
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
autofixer: follow-up triage: bug triage: classified triage: correctness triage: has-reproducer
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
tursodatabase/turso#13221 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
approved
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
fritzprix/libr-agent#3266 ·
Maintainers usually reply within 1 day