-
Notifications
You must be signed in to change notification settings - Fork 642
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
Even small programs can be too big #4934
Comments
For V1 we want to make sure the 927 panic code is only triggered at the point a V2-only feature is about to be executed, so a programme like the one Jonny posted above should run normally until the accelerometer 6G event is triggered. Looking at the
|
@riknoll this should be fixed as well right? |
Yup! |
Has the fix been deployed to beta already? Still seeing a large memory usage of the [play sound] block for V1, which should really only raise a panic. |
no it has not, let me bump beta right now! |
Awesome, thanks! Somewhat related, in beta at least, the original programme that Jonny posted has gotten worse in terms of memory. It used to be 252 bytes over the V1 limit and it is now 320 bytes over the limit. As DAL hasn't been updated, I assume the extra memory is consumed by MakeCode? Or is the size calculation made from the CODAL build? |
shouldn't be based on the codal build... not sure what's causing the change there. |
Just tested the latest 5.1.14 in beta and can confirm the V1 build is not as large anymore 🎉 Although removing the [play sound] block still has a significant difference in size. With block:
Without it:
Which still feels like a lot. If this number is not accurate enough, how can we check the real number? |
after you click the download button, the built folder in the file explorer below the sim (same place where you got binary.js) will contain two more files: mbdal.asm and mbcodal.asm. They only show up after you've done a download. Those have the actual binary compile size in comments at the top! As for the other point, that's because we've implemented this in TypeScript instead of C++; we don't have IFDEFs in TS so the code is being included even in the micro:bit V1 compilations. How much of a scenario is this for the micro:bit V1? if it's just going to panic anyway, do we expect people to be downloading programs for their V1 micro:bit that include these V2 blocks? |
I agree with Richard, lets not spend time on v1 size if the program is going to panic anyway. |
After the switch to gcc5, this program builds with 4k memory to spare. The improvement will be available in the v6 release (currently live in beta channel). |
While this issue started a simple example to show how small programmes didn't fit in V1, I think we uncovered that some blocks that are V2-only seem to be taking large amounts of memory in V1 (>15KB), when they should only be triggering a panic in V1. While this might not initially seem that important (after all, V2 blocks would fail in V1 anyway), the "out of V1 memory" error would would be shown all users and might be confusing. |
@microbit-carlos that makes sense. Can you please file an issue? |
Describe the bug
With MakeCode V5, we know some programs can get quite large, but until now I thought this was really limited to things that used extensions. See #4788
However, here's a very small program that still won't fit on a V1.
https://makecode.microbit.org/_bfs6mzETmeUi
To Reproduce
The start melody block is definitely part of the problem, and we know from #3868 that there was a bit of a longstanding issue with this.
However, this program feels unreasonably small not to work
The text was updated successfully, but these errors were encountered: