Switch to an all max implementation #23
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CC: @whimsical-sam
Four hours later I finally got this somewhere that feels ok.
I stripped out the lua layer from the max object, and specifically reimplemented
crowmax.lua
as a sub-patcher of raw max objects. It's a little more difficult to follow as it uses a bunch of [regexp] to parse the strings (and I'm a regex novice), but I think the code is actually pretty clean for what it achieves.I also kinda drastically refactored the patching at the top layer, removed some repetition, and (i believe) made the logic easier to follow. I believe I covered all of the edge cases in the lua code, but I would suggest some heavy testing before we make it public.
A couple things I didn't touch, but could potentially be improved in light of this:
This is only in the max implementation (not m4l) so that will need to be copied once we confirm it's still working. That said, the main reason I dove into this was to workaround the lua scheduling issues @dndrks has been mentioning.
Feedback is welcome, but if someone else wants to jump in and make changes / fixes I'm happy with that!