Ran out of Macro Space!

Macros on UHK are quite easily the best the planet has to offer, which is why the 32Kb limit on the board is oh so painful! The UHK 80 is tempting but it’s just so hard to improve over the v2, I’m curious if the 80 has more flash storage for more macros??? If not, wondering if there’s some way to substitute the board while keeping UHK Agent happy or otherwise v3 even just going to 64 Kb is a hard sale on my end!

Keep up the great work and I’ll be able to meet my maker without ever needing a neuralink installed.

1 Like

:smiling_face_with_tear:

Thanks for checking! Told myself I might have a problem if I ever sacrifice all per key colors and still run out of macro space, I definitely have a problem.

The UHK 80 currently exposes the same 32K configuration space as the UHK 60. We may extend the UHK 80 configuration space eventually because we have some leeway, but given the ~0.1% of users who run out of flash space, it’s questionable whether the effort is worth it.

What makes your configuration so large?

It’s a fair argument. I have 5 layers across 3 keymaps and deep macro scripts for terminal CLIs and programming languages, so even pretty condensed scripting adds up quickly, niche to be sure. If it’s just a “change this constant in code” thing I’d be tempted to build the FW+Agent myself on a fresh 80. You’d at least make >= 2 sales if it works ha.

Thanks and by my count 3 years as undisturbed best keyboard of Earth.

1 Like

It’s not as easy as changing a constant, but future UHKs will likely have at least twice the configuration space.

Thanks for the kind words!

Yeah, I keep having to limit myself, too. I’m almost out of space, and I haven’t even configured any per-key backlighting.

image

What do you have as macros to use all the space?

It’s a combination of a decent amount of macros and a few keymaps with lots of layers.

It sounds like a quick win for users to recover space could be for us to delete unused keymaps. I dont use Colemac, for example. @maexxx, do you know if this will work?

2 Likes

What sort of macros do you have?

I have two key maps with four layers each and I thought I had a lot of macros. But I still have only used 50%

Deleting unused keymaps and layers will definitely save sognificant amount of space, especially if per key rgb is enabled.

(We plan to implement an optimization to reduce the amount of space occupied by sparsely populated layers, but we have more pressing matter these days…)

As for increasing the config size, we are short on RAM.

For uhk80 it may or may not be as easy as changing a constant - I doubt that uhk80 will fit into 128kb, but it might.

Otherwise there are these things can theoretically be done, but are technically nontrivial:

  • refactoring the firmware so that it uses only one config buffer instead of two. Then the saved space could either be used for new features, or for increasing config size.
  • compiling macros into bytecode on the firmware size, so that only the byte ode is held in RAM; This would also speed up macro execution a lot
  • compiling macros into bytecode agent side.

Unfortunately considering available development time, priorities and rate at which new issues spawn, I don’t expect I will ever get to it :face_with_diagonal_mouth:.

I was almost going to suggest the 2nd in the lazy form of, give me iKA in addition to ifKeyActive, but yeah sounds like compiling to bytecode is even better.

This is what happens when you make a nice Turing complete scripting language people like us will abuse it :slight_smile:

2 Likes

Compiling to byte code when loading into RAM really sounds like a good strategy!

:thinking:

Just a formal nitpick and a fun fact:

Iirc, current named variables do not support indirect access, which means that the only way to access something that resembles an infinite tape is to pretend that variables can store arbitrarily large numbers and perform arithmetics to store (arbitrarily many pieces of) information there.

While feasible, it is also very impractical.

We don’t even support local variables and argument passing to macro calls…

Which means that unless we resort to the above abuse, the strength of the language is even below a push down automaton :smiley:. (Arithmetics can be used to implement some push down automatons, but not all.)

(Also sorry, I just don’t know how to accept a compliment :grin:.)

3 Likes

I’m not gonna pretend I understand even half of what you guys are talking about, but I do know how to make people uncomfortable so…

Here’s a hug from a grown-a$$ bearded dude.:hugs::people_hugging:

You do some great work Karel.

5 Likes

(Btw., that shouldn’t be too hard to implement - you are welcome to start a fork with such support. :person_shrugging:)

1 Like

Correction: extremely finite Turing complete scripting language :white_check_mark: I added some infinite tape to my UHK right now tho just to make you wrong again.

2 Likes

Honestly reading about people running out of space makes me feel FOMO as if I’m not making the best out of the keyboard. But even layers beyond Fn & Mod are way more than what I seem to need.

2 Likes

@layr With your user name I would have expected many more layers! :wink:

2 Likes