Skip to content

use normal entrypoints into base's display pipeline#736

Open
rokke-git wants to merge 3 commits into
JuliaSparse:mainfrom
rokke-git:detangle-output
Open

use normal entrypoints into base's display pipeline#736
rokke-git wants to merge 3 commits into
JuliaSparse:mainfrom
rokke-git:detangle-output

Conversation

@rokke-git

@rokke-git rokke-git commented Jul 16, 2026

Copy link
Copy Markdown

Base and SparseArrays had some funky action-at-a-distance stuff going on, this fully disentangles the printing functions. this is what I really came over here for, the type thing was just me hoping to simplify things a bit. didn't end up effecting much, but does add the circular_reference line.

it also makes SparseArrays a little smarter about when to swap to braille output, and actually uses the whole screen instead of just the left half. it's also theoretically doing less work now, but it's just a printing function so whatever. the width of displayed zeros also doesn't depend on the type anymore, and is always centered.

since this removes the error that used to come up during printing, I added in a new warning to replace it.

fixes: #21, #22, #233, #618

@rokke-git

rokke-git commented Jul 16, 2026

Copy link
Copy Markdown
Author

lol, guess the doctests are a good way of displaying what's changed...

@rokke-git
rokke-git force-pushed the detangle-output branch 4 times, most recently from 0516cde to 5e7647d Compare July 16, 2026 05:53
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.45%. Comparing base (751387e) to head (1eb9e69).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #736      +/-   ##
==========================================
+ Coverage   84.40%   84.45%   +0.05%     
==========================================
  Files          13       13              
  Lines        9374     9394      +20     
==========================================
+ Hits         7912     7934      +22     
+ Misses       1462     1460       -2     

☔ View full report in Codecov by Harness.
📢 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.

@rokke-git
rokke-git force-pushed the detangle-output branch 4 times, most recently from 187b579 to 2a637f6 Compare July 16, 2026 07:35
@rokke-git

Copy link
Copy Markdown
Author

since I'm already here, started looking through existing display issues.
now fixes: #21, #22, #233, #618

@rokke-git
rokke-git force-pushed the detangle-output branch 3 times, most recently from 4aba457 to 5de63a2 Compare July 16, 2026 17:32
@rokke-git

rokke-git commented Jul 16, 2026

Copy link
Copy Markdown
Author

this last push just changed the Matrix(x) conversion call as specified in #618 from dest[isrc[row, col]] = val to dest[isrc[row, col]] += val, which technically adds a get to a potentially hot loop (ie, not display, actual computation).

if this should instead be actually benchmarked I can remove this change; or if we don't care it can remain fixed like this. the dest matrix was already initialized with basically zero(eltype(x)), so Matrix(x) would have already been failing for non-numeric types, no change there

@rokke-git
rokke-git force-pushed the detangle-output branch 5 times, most recently from 1ba3b0f to 7969cbe Compare July 16, 2026 18:34
@rokke-git

rokke-git commented Jul 17, 2026

Copy link
Copy Markdown
Author

I'd say this last commit fixes #420 as well; it's much more clear that it's an image of your actual matrix now that there's no aliasing

@rokke-git
rokke-git force-pushed the detangle-output branch 6 times, most recently from afd9e00 to 18239c4 Compare July 17, 2026 04:02
Base and SparseArrays had some funky interactions going on
with replace_in_print_matrix, this fully disentangles the
print funcs. it also makes SparseArrays smarter about swaping
to braille, fixes aliasing, and generally makes printing more
robust.
@rokke-git

Copy link
Copy Markdown
Author

ok, I made a couple final tweaks and then sorted all the changes into 3 sensible commits. only have it separated out so it's easier to look at, can be squashed for merging; the first commit message counts for all three. any other changes you want me to make?

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.

Spy printing of sparse matrices is inaccurate

1 participant