0xMiden / 0xMiden/compiler

Discrepancy in `Smod` op from `arith` dialect

Aperta Adatta ai principianti
#1,172 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
115
Fork
84
Merge medio
1g 8h
PR unite (30g)
15

Descrizione

https://github.com/0xMiden/compiler/blob/d14633739317d08da63b089eb1bc73abfa4a3539/dialects/arith/src/ops/binary.rs#L254-L256

The result of Euclidean rem should always be positive (see e.g. [Rust docs](https://doc.rust-lang.org/std/primitive.i32.html#method.rem_euclid)), however the comment says

> The result has the same sign as the dividend (lhs)

Note that the lowering for `Smod` is not yet implemented.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

The issue points to the `Smod` operation in `dialects/arith/src/ops/binary.rs`. Review the comment and implementation to ensure it matches Euclidean remainder semantics (always positive). Check if there are existing tests for `Smod` in the test suite. The lowering for `Smod` is not yet implemented, so ensure any fix aligns with the intended behavior before implementing the lowering.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
compilers
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Tranquilla
Chiarezza
Specificata chiaramente
Idoneità per principianti
70/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.