Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: Implemented some wrapping examples using shape the term package #53

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jmcavanillas
Copy link
Contributor

Opening this PR to include wrap and wrap by word showcases using https://github.com/jmcavanillas/shape-the-term

The examples are functional and ready for review but there are a couple of issues to address,

To be completed / addressed before merging:

  • If I do not set fps to a low value my computes just go BRRRRRR! 🔥 and input starts to lag (actually maybe there is no solution yet for this as I think we will need a state diffing solution or similar)
  • I have to pin the shape-the-term repo to main, I would like to include it as pin-depends but I have no idea yet
  • Add VHS gifs
  • BONUS: Update readme example for Spices, there is no render function anymore

@leostera
Copy link
Owner

Thanks for the PR @jmcavanillas! Re: the CPU usage, are you testing this on the latest Minttea with Riot 0.0.9?

@jmcavanillas
Copy link
Contributor Author

I am testing with minttea main branch and riot 0.0.8, I tried to update to riot 0.0.9 but dune did not want to build due to a warning with receive function parameters I think. I will try again this afternoon and share the exact error I get when building

@jmcavanillas
Copy link
Contributor Author

Yeah I think minttea need an update to work with riot 0.0.9, I see you have a branch with some updates about it

~/Projects/minttea$ dune build --profile release
File "minttea/io_loop.ml", line 49, characters 10-20:
49 |   let _ = receive () in
               ^^^^^^^^^^
Warning 5 [ignored-partial-application]: this function application is partial,
maybe some arguments are missing.
File "minttea/renderer.ml", line 31, characters 4-12:
31 |   | Shutdown ->
         ^^^^^^^^
Error: This pattern should not be a constructor, the expected type is
       selector:(Riot.Message.t -> [ `select of 'a | `skip ]) -> 'a
File "minttea/program.ml", line 13, characters 6-15:
13 |     | Timer ref -> Event.Timer ref
           ^^^^^^^^^
Error: This pattern should not be a constructor, the expected type is
       selector:(Riot.Message.t -> [ `select of 'a | `skip ]) -> 'a
File "minttea/io_loop.ml", line 49, characters 10-20:
49 |   let _ = receive () in
               ^^^^^^^^^^
Warning 5 [ignored-partial-application]: this function application is partial,
maybe some arguments are missing.

@jmcavanillas
Copy link
Contributor Author

jmcavanillas commented Apr 17, 2024

I have merged your updates to minttea and now they usually work better at 60 fps and the CPU fans behave better but sometimes they do not.

Now there is a new issue, when I enter some text in the input and then press intro to finish the program, sometimes it finishes as expected, but other times it just print final output but does not finish, it gets stuck, and the fans go BRRR! 🔥 again.

A) Steps to reproduce

  1. build the examples
  2. dune exec examples/text-wrapping/main.exe or dune exec examples/word-wrapping/main.exe
  3. Enter random text, I did it fast as it was just random letters and spaces
  4. Press intro
  5. (Sometimes it works, others it just gets stuck before exit and you have to Ctrl + C)

B) I run the example multiple times at 60 fps without rebuilding and some runs present heavy input lag.

Setting fps to a lower value seems to reduce the lag cases but I still experience issue A at 2 fps

OS: Fedora Linux 39 (Workstation Edition) x86_64
Kernel: 6.8.5-201.fc39.x86_64 
Uptime: 1 hour, 9 mins 
DE: GNOME 45.5 
CPU: AMD Ryzen 7 7700X (16) @ 5.573GHz 
Memory: 4942MiB / 31228MiB 

@jmcavanillas
Copy link
Contributor Author

jmcavanillas commented Apr 17, 2024

Hang Video: (The program exits because I press Ctrl +C)

Grabacion.de.pantalla.desde.2024-04-17.20-35-30.webm

I have another larger video showing lag and much higher CPU usage but I cannot upload it here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants