Skip to content

feature: clean up user-visible build-error tracebacks#104

Merged
rmshaffer merged 10 commits into
mainfrom
rmshaffer/error-ux
May 8, 2026
Merged

feature: clean up user-visible build-error tracebacks#104
rmshaffer merged 10 commits into
mainfrom
rmshaffer/error-ux

Conversation

@rmshaffer
Copy link
Copy Markdown
Contributor

@rmshaffer rmshaffer commented May 4, 2026

Issue #, if available:

Description of changes:

Hides AutoQASM-internal and malt-internal frames from tracebacks surfaced by build errors, so users see lines that are relevant to the code they wrote, not the transpiler's internal call stack. Makes typical @aq.main / @aq.subroutine compile errors have significantly shorter tracebacks and therefore easier to read.

Testing done:

tox passes. Validated UX in some error cases manually.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9d23d5a) to head (0d1d1bb).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #104   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           50        52    +2     
  Lines         2201      2279   +78     
  Branches       254       266   +12     
=========================================
+ Hits          2201      2279   +78     

☔ 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.

@rmshaffer rmshaffer marked this pull request as ready for review May 4, 2026 17:48
@rmshaffer rmshaffer requested a review from a team as a code owner May 4, 2026 17:48
Comment thread src/autoqasm/_frame_filtering.py Outdated
# ``__autograph_generated_file*.py`` scratch module in the OS tmp dir;
# those frames are noise as well. We deliberately keep ``oqpy`` frames
# since they can point at meaningful type errors.
_INTERNAL_PATH_MARKERS: tuple[str, ...] = (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this will be difficult to keep up-to-date over time. Do we have any other options? Could we include all of autoqasm and exclude specific subdirs we don't want to include?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree this feels fragile. Let me think about it some more.

Copy link
Copy Markdown
Contributor Author

@rmshaffer rmshaffer May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to use a flag __filter_from_traceback__ which can be set at the module-level or subpackage-level as a marker to exclude it from tracebacks.

@rmshaffer rmshaffer merged commit 1a50df3 into main May 8, 2026
18 checks passed
@rmshaffer rmshaffer deleted the rmshaffer/error-ux branch May 8, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants