Comments (9)
There are actually quite a few instructions that can trap for various reasons, and have this issue. One can work around this specific case by using u32assert.err=ERR
on the operands at least, but that's definitely a pain.
I think the larger issue of being able to pinpoint where an error/assert was triggered will need to be solved with debug info. Without debug info, even when you can specify an error code, it is still not particularly helpful in quickly finding the cause. With debug info, we can at the very least provide the location in the original source code, and in cases where we have sources available, we can even render the source snippet that is relevant. More importantly, it would work well across all instructions, whether the error is explicitly triggered with an assert, or implicitly triggered by the semantics of a specific instruction.
Maybe we should add a tracking issue for that, where we can work out the details, and link all these issues to that one?
from miden-vm.
@bitwalker sounds good to me 👍
from miden-vm.
One note: adding error codes to instructions which also support immediate values may be a bit tricky (or at least may require modifying syntax a bit). So, this may conflict a bit with #1301.
from miden-vm.
@bobbinth I think it could be an either or situation:
u32assert.err=ERR
u32and.0xFF
OR
u32and.err=ERR
In other words, validating the sole operand for the immediate variant is trivially done with u32assert.err=ERR
, so we probably don't need to support both at the same time.
from miden-vm.
We could do the same for both operands:
u32assert2.err=ERR
u32and
And this will actually be faster than using u32assert
as u32assert
is just syntactic sugar on top of u32assert2
(so, u32assert2
takes 1 cycle while u32assert
takes 3 cycles).
from miden-vm.
Ah right, always forget about u32assert2
!
from miden-vm.
Related Issues (20)
- Allow querying constant values from a compiled module
- Allow querying exported procedures MAST roots from compiled modules HOT 6
- Forbid reserved words in procedures names HOT 1
- CI: switch to `cargo nextest` HOT 1
- MaslLibrary should validate the code it compiles HOT 3
- MaslLibrary should validate code that is deserialized
- Assembler should not hide inner errors on re-exports HOT 1
- MASM errors should track origin HOT 3
- MASM arithmetic instructions should accept constants HOT 3
- u32 bitwise operations should accept immediate values
- allow odd number of characters in hex constants HOT 2
- Add recursive call limit HOT 4
- MASM test runner HOT 1
- Add procedures to initialize the hasher state HOT 2
- Add procedures to read and verify data from the advice stack HOT 3
- Test sha256_hash_memory is flaky
- Add mutation testing strategy HOT 3
- Create method to add list of values to advice provider
- Change `FailedSignatureGeneration`'s inner type to `String`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miden-vm.