Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@AJMansfield
Copy link
Contributor

@AJMansfield AJMansfield commented Nov 6, 2025

Summary

This PR adds a --json option to mpy-tool in order to generate Compiler-Explorer-compatible JSON annotation information for the bytecode disassembly. Some of this information might be theoretically possible to parse out from the text itself, but not all of it is, e.g. disambiguating child references with non-unique simple names.

Testing

I've tested these changes against a locally-hosted version of Compiler Explorer, and run autobuild to the extent I'm able to and confirmed the creation of appropriate artifacts --- but as these changes integrate with parts of MicroPython's infrastructure I have no staging environment for, I'll need help from the maintainers here to test important parts of this.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.38%. Comparing base (2762fe6) to head (e2aab64).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #18381   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files         171      171           
  Lines       22294    22294           
=======================================
  Hits        21933    21933           
  Misses        361      361           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Code size report:

Reference:  tests/serial_test.py: Allow up to 2 seconds between bytes. [2762fe6]
Comparison: tools/mpy-tool: Add Compiler Explorer JSON output. [merge of e2aab64]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@AJMansfield AJMansfield marked this pull request as draft November 7, 2025 00:07
@AJMansfield AJMansfield force-pushed the godbolt branch 6 times, most recently from 5faa3fc to 7ca6ad7 Compare November 7, 2025 19:36
@AJMansfield AJMansfield marked this pull request as ready for review November 7, 2025 19:45
@dpgeorge dpgeorge added the tools Relates to tools/ directory in source, or other tooling label Nov 9, 2025
@AJMansfield AJMansfield force-pushed the godbolt branch 3 times, most recently from 900a7a0 to 9eb1ff4 Compare November 9, 2025 18:59
@AJMansfield
Copy link
Contributor Author

AJMansfield commented Nov 9, 2025

Oh, just to show a screenshot of the actual results of using this plus my testing configuration on Compiler Explorer:

image

@AJMansfield AJMansfield force-pushed the godbolt branch 2 times, most recently from 154aba8 to 7d26a5c Compare November 9, 2025 19:17
@Josverl
Copy link
Contributor

Josverl commented Nov 9, 2025

Oh, just to show a screenshot

Thanks, that speaks a thousand lines of code

Now I can (begin to) understand why this would be useful

@AJMansfield AJMansfield requested a review from dpgeorge November 9, 2025 20:22
@projectgus projectgus requested review from projectgus and removed request for projectgus November 11, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Relates to tools/ directory in source, or other tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants