Repository navigation
Conversation
Main's reuse test only edits the string. Changing font, spacing, alignment, line height, or wrap width one at a time catches a cache key that drops one of those. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Someone is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
| assert!( | ||
| expected != base_pixels, | ||
| "{name} edit should change the output" | ||
| ); |
There was a problem hiding this comment.
Installed fonts change test results
The expected != base_pixels check depends on the host's installed fonts. If two requested choices resolve to the same face, this assertion fails even when cached and fresh layouts match. new_font_system() scans system fonts, but the test supplies no fixed regular, bold, italic, or monospace faces. Supply a fixed font set so this test checks cache behavior rather than the host's font collection.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/rendering/src/layers/text.rs
Line: 1102-1105
Comment:
**Installed fonts change test results**
The `expected != base_pixels` check depends on the host's installed fonts. If two requested choices resolve to the same face, this assertion fails even when cached and fresh layouts match. `new_font_system()` scans system fonts, but the test supplies no fixed regular, bold, italic, or monospace faces. Supply a fixed font set so this test checks cache behavior rather than the host's font collection.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Addressed in d3de3eb.
Family, weight, and italic no longer have to change the pixels. Those only look different when the machine has a separate face, and this test uses the system fonts. Each of those edits now fails unless the previous buffer stays unused and the warmed layer's pixels match a fresh layer. Dropping family, weight, or italic from the cache key reuses the old buffer, so previous_buffers is empty and the test fails.
Font size, letter spacing, alignment, line height, and wrap width still have to change the pixels. Those move the glyphs on any font that can draw the string.
|
Thanks @notkainoa! Greptile is at 4/5 here. We only merge once Greptile reaches 5/5, so please address its findings in the summary above (or reply to them if you think one is wrong), then comment |
Family, weight, and italic fail when the previous buffer is reused. Edits that move glyphs still have to change the pixels. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@greptileai review |
Follow-up to #2524. The text cache is already on main, so that PR conflicts. This is only the test you asked for.
The existing test only checks that changing the words throws the old layout away. This one changes font size, family, weight, italic, letter spacing, alignment, line height, and wrap width one at a time on a warmed layer, and compares the pixels to a fresh layer. Dropping any of those from the cache key fails the test.
No speed change.
cargo test -p cap-rendering --lib reused_layouts_follow_each_shaping_input -- --ignoredpasses.cargo clippy -p cap-rendering --lib --tests -- -D warningsis clean.Made with Cursor
The PR appears safe to merge, with a non-blocking test reliability concern.
Findings
Fix with agent prompt
Summary
Adds an ignored GPU test that compares a warmed text layer with a fresh layer after eight shaping edits.
Reviews (1) · Last reviewed commit: "test(rendering): check the text cache ag..." · Reviewed by Greptile