cartesi / dave

Cartesi fraud-proof system
Apache License 2.0
13 stars 11 forks source link

Add doom showcase #39

Closed stephenctw closed 1 month ago

stephenctw commented 2 months ago
stephenctw commented 2 months ago

@GCdePaula @guidanoli could you please try to run the doom-showcase locally? Let me know what you think. Also, any suggestions for testnet deployment?

guidanoli commented 2 months ago

I don't know if the stress test was successful or not. It just prints out Hello from Dave lua prototype! and exits with status code 137, which tells me it might not have been successful?

Also, I felt the timeout quite dreadful. Would it be possible to reduce it just for the purposes of running the tests locally and not having to wait such a long time? I might not be aware of any undesired side effects of such a change, so please tell me if there is a reason why we shouldn't mess with the timeout just for testing purposes.

stephenctw commented 2 months ago

@guidanoli It's definitely not successful with exit code 137. Is there any more information from the console logs? Also, which version did this happen? The pure lua-node version or the offchain + lua-node combination? For the timeouts, I think most of the time are spent on the machine computation. But the timing constants are set based on my machine performance, it may vary from yours. I'll try to update a measurement script that @GCdePaula wrote and you can try to run it to generate different timing constants for your machine.

stephenctw commented 2 months ago

@guidanoli now you can go to permissionless-arbitration/measure_constants directory and run the script to generate timing constants that fit better to your machine.

guidanoli commented 2 months ago

Is there any more information from the console logs?

No, just the line Hello from Dave lua prototype!.

which version did this happen?

I just ran the command that was on the README under permissionless-arbitration/lua_node:

docker run --rm \
    --env MACHINE_PATH="/app/lua_node/program/debootstrap-machine-sparsed" \
    --env DEPLOY_TO_ANVIL="true" \
    dave:latest
guidanoli commented 2 months ago

now you can go to permissionless-arbitration/measure_constants directory and run the script to generate better fitting timing constants for your machine.

Thanks! Tomorrow I will try it out.

guidanoli commented 2 months ago

@stephenctw and I hopped on a call to investigate the issue with the stress test not working, and it seems that the issue was the memory limit set by Docker. I set the memory limit to 3.8 GB, and swap to 2 GB, and it worked like a charm. Thanks, Stephen!

stephenctw commented 2 months ago

@guidanoli I add the graphic feature to the doom showcase. I only add this to the Lua prototype as it can reduce performance of the Dave process. Please let me know if I should also add this to the Rust Dave (production code).

I did this in a hacky way, suggestions are very welcomed.

guidanoli commented 2 months ago

In my case, I had to create the snapshot folder manually. Maybe worth putting instructions on the README to do so as well.

mkdir snapshots
guidanoli commented 2 months ago

Managed to run it! The color palette is indeed a bit glitchy. Some white and blue pixels seem out-of-place.

Screencast from 01-05-2024 09:25:36.webm

guidanoli commented 2 months ago

Maybe worth trying to extract the palette from the machine as feeding it into the playpal2rgb tool (which I updated to accept such palette as input rather than having it hard-coded).

stephenctw commented 2 months ago

Maybe worth trying to extract the palette from the machine as feeding it into the playpal2rgb tool (which I updated to accept such palette as input rather than having it hard-coded).

Sure, once Eduardo gave me the range of memory region, I'll update it.

stephenctw commented 1 month ago

Rebased the branch on top of main, updated all the examples to use machine-emulator 0.17.