-
Notifications
You must be signed in to change notification settings - Fork 13
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
Maybe "by design"?: x = 1
creates two Mindustry Logic instructions
#11
Comments
Yup! I'm aware of this. In the code that is on https://mindcode.herokuapp.com/, I had to disable the optimizer. I remove it in 1c6afb3. I'm in the process of writing a better optimizer pipeline, and it is nearly ready. I don't want the new optimizer to generate more bugs than the old one! The 1000 instructions limit of Mindustry Logic is something I encountered a short while ago. I need to make some tests: is it 1000 or 1024 lines? I wouldn't be surprised if it was the latter (2**10). I still want to give a warning to the developer about the problem, so they know they need to split their logic into multiple, independent, processors. I won't promise when the new optimizer pipeline will be on main / production, but it shouldn't be too long. Pretty sure it'll be there this weekend, at the latest. Anyway, thanks for taking the time to report all those bugs and misfeatures. I really appreciate you doing this. |
Good evening @francois , In Mindustry 126.2 (actually the lastest release) it just imports max. 1000 lines from the clipboard, I have tested it :-) By the way, this limit is independent of the used Mindustry Processor ('Micro Processor', 'Logic Processor' or 'Hyper Processor') It's great to hear you have an optimiser pipeline. It's sad that the Mindustry logic doesn't have string functions, otherwise it might be an elegant idea to test the optimiser this way, by having the code generate strings for each test, which you can then quickly compare to the expected result:
Maybe it is too simplistic... |
Some assignments are unused. If a case/when expression does not use the result, then the assignments are useless and can be removed. This reduces the total number of instructions, improving our ability to cram more code into a processor's memory. Part of #11
Good evening
my mindcode source created more than 1000 Lines of Mindustry Logic instructions (I have tried to create a generic Ressource manager for factories using drones).
Btw.: Good to know: If one tries to import more than 1000 Logic instructions into Mindustry, then the game will silently remove all instructions after the 1000th line :-( Therefore, one starts searching non-existent bugs...
This issue is maybe the result of the AST design, maybe it's a bug. I know programming compiler optimization is hard work and I was not able to find the source of this issue.
I report the problem anyway.
You can close it again as "it's too much work" - after all, we're talking about a game. 🙂
This code:
Creates two Mindustry Logic instructions:
This optimization would make the compiled code twice as fast 😊😉
Thanks a lot, kind regards,
Thomas
The text was updated successfully, but these errors were encountered: