Repository navigation
Keep the stacks aligned on their top in PSStackToTree - #22417
Conversation
calixteman
left a comment
There was a problem hiding this comment.
Overall it LGTM, but your LLM missed a caller in src/core/internal_viewer_utils.js.
When the two paths of a stack-growing `if`, or the two branches of an `ifelse`, end with different stack depths, the shorter stack was padded with zeros on its top. The following operators then used these zeros instead of the actual values: for example the tint transform in issue5470.pdf is only correct when its guard fires, i.e. for a tint of 1, and any other tint is rendered in a darker red instead of red. Pad the bottom of the shorter stack instead. And when a function leaves more values on the stack than it has outputs, use the ones at the top, as the interpreter does, instead of the ones at the bottom.
91e2135 to
0aaac44
Compare
|
Good catch, thanks. |
Viewer preview🗑️ Viewer previews removed. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22417 +/- ##
==========================================
- Coverage 90.58% 90.57% -0.01%
==========================================
Files 278 278
Lines 68586 68665 +79
==========================================
+ Hits 62126 62193 +67
- Misses 6460 6472 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 0.45%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Fixes #22415
When the two paths of a stack-growing
if, or the two branches of anifelse, end with different stack depths, the shorter stack was padded with zeros on its top, so the following operators used these zeros instead of the actual values. The shorter stack is now padded at its bottom.And when a function leaves more values on the stack than it has outputs, the Wasm/JS compilers now use the ones at the top, as the interpreter does.
The first row of the new reference test uses the tint transform from
issue5470.pdf, which is currently only right for a tint of 1.