Conversation
|
I agree this is great! I don't see any issue with merging it except potentially that not many of us really know Lean. Would you be willing to maintain it. Also what are you using it for, just out of curiosity? (And on the other hand, learning Lean has been on my todo list for ages so maybe this is a good excuse to finally get around to it!) |
There's a group of us at Galois and Cambridge who have been working on Sail's Lean backend so we can help if things break. |
d22911a to
e9c4ec3
Compare
|
Alright, I have made a lot of changes, and it's back to being reviewable:
EDIT: The CI is currently failing because of this limitation: |
e9c4ec3 to
32b1eec
Compare
32b1eec to
b29db0f
Compare
There was a problem hiding this comment.
This file needs to pass pre-commit checks. See
Line 33 in c4d3140
There was a problem hiding this comment.
I will look at the pre-commit fix.
As for the resources, I have been building it on a powerful laptop so I'm not sure.
Anecdotally, on our Github CI, the Lean emulator build seems to take ~8 minutes.
There was a problem hiding this comment.
I fixed the pre-commit problem. As for the slowness of it, I'm open to suggestions, in particular:
- maybe this could be run daily rather than per commit?
- we could definitely trim the list of ELF files to test, it's somewhat arbitrary.
b29db0f to
1a4ce49
Compare
| } | ||
|
|
||
| function loop () : unit -> unit = { | ||
| function loop () : unit -> int = { |
There was a problem hiding this comment.
| function loop () : unit -> int = { | |
| function loop () : unit -> nat = { |
Presumably?
There was a problem hiding this comment.
Good point, in fact I'm not sure what a Sail int is, so maybe we should be careful.
It seems we start with a htif_exit_code, with declared type bits(64), so I guess this is a sign-agnostic view of it.
I wrote int because I had in mind the typical C status codes, e.g. return -1;, where they are typically considered signed. But this is likey inconsistent with the call to unsigned at:
let exit_val = unsigned(htif_exit_code);
So the question is, either:
- we want to view exit codes as signed, in which case we would leave
intbut replaceunsigned(...)withsigned(...), or, - we want to view exit codes as unsigned, in which case we would replace
intwithnat.
Do you have more knowledge on the reasonable thing to do here?
| ) | ||
| foreach(file IN LISTS LEAN_EMULATOR_TEST_ELFS) | ||
| message(STATUS "Testing Lean emulator on file ${file}") | ||
| execute_process( |
There was a problem hiding this comment.
Wouldn't it make more sense to add lake build ... as a normal CMake target, and then add these as CTest tests? I can sketch out the code if you don't want to learn CMake (which would be very very understandable!)
There was a problem hiding this comment.
Please do! I am indeed not used to CMake and have been teaching myself in order to produce what you're currently seeing.
There was a problem hiding this comment.
Hi @Timmmm , just checking on whether you have bandwidth to look into this, or if I should figure it out.
Opening this pull request for discussion about what it would take to integrate these changes upstream.
This PR contains:
There are, however, a couple of things that ought to be discussed:
Putting this as a draft request for now.