Skip to content
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fe79d5e
fix(ci): stabilize verify-capture fallback-grey test on fontless host…
qwen-code-dev-bot Sep 2, 2026
2bddc17
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 2, 2026
7dab18d
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 2, 2026
d24a6f2
test(ci): require near-neutral pixels in the verify-capture fallback …
qwen-code-dev-bot Sep 2, 2026
d311ec3
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 2, 2026
8bfefaa
test(ci): keep a mid-grey fallback out of the verify-capture count (#…
qwen-code-dev-bot Sep 2, 2026
c135f7d
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 2, 2026
5c25c75
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 3, 2026
8763adc
Merge branch 'main' into autofix/issue-10757
yiliang114 Sep 3, 2026
d7fc5cb
test(ci): tighten the verify-capture fallback spread bound (#10758)
qwen-code-dev-bot Sep 3, 2026
82769e4
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 3, 2026
abac4b7
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 3, 2026
4f643cc
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 3, 2026
9773fce
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 4, 2026
db45023
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 4, 2026
2fd5750
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 5, 2026
0c4cefe
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 5, 2026
372b575
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 5, 2026
81ee054
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 5, 2026
96820d6
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 5, 2026
ab4c195
Merge branch 'main' into autofix/issue-10757
qwen-code-dev-bot Sep 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions scripts/tests/verify-capture.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,35 @@ describe('verify-capture helper', () => {
const { data, info } = await sharp(png)
.raw()
.toBuffer({ resolveWithObject: true });
// FG_DEFAULT is #d4d4d4 — look for a pixel matching it.
let hasFallback = false;
// FG_DEFAULT is #d4d4d4. Text is anti-aliased, so how many pixels land
// exactly on it depends on the host's font rasterisation, and the exact
// scan flaked. Count bright near-neutral pixels instead — both ends of
// the blend axis (#d4d4d4 over #1e1e1e) are neutral, so every blend of
// them is neutral at any coverage, while a grossly tinted FG_DEFAULT or
// the hardcoded #9cdcfe title fill is not and cannot satisfy the count
// in the fallback's place. The bound is tight because this pipeline never
// fringes (measured max spread 0) — slack would only let a tinted
// FG_DEFAULT (#d4d4c8) pass; the floor is strict to keep a mid-grey
// FG_DEFAULT (#808080) out. Deleting the guard ships fill="undefined",
// which librsvg paints black, never this bright on #1e1e1e.
let fallbackPixels = 0;
for (let i = 0; i + 2 < data.length; i += info.channels) {
if (data[i] === 0xd4 && data[i + 1] === 0xd4 && data[i + 2] === 0xd4) {
hasFallback = true;
break;
const spread =
Math.max(data[i], data[i + 1], data[i + 2]) -
Math.min(data[i], data[i + 1], data[i + 2]);
if (
data[i] > 0x80 &&

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Brightness floor: all channels > 0x80 (128). For the #d4d4d4 over #1e1e1e blend axis, a pixel at coverage a has channels = 30 + 182*a, which exceeds 128 when a > 53.8%. Visible text glyphs satisfy this on any rasteriser. Canvas background (#1e1e1e, R=30) and title fill (#9cdcfe, spread=98) are both excluded.

data[i + 1] > 0x80 &&
data[i + 2] > 0x80 &&
spread <= 4

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Spread <= 4 is the neutrality gate. Both #d4d4d4 and #1e1e1e have equal R/G/B, so every blend between them also has spread=0. Any saturated color like #9cdcfe (spread=98) cannot pass here, ruling out false positives from the title fill color.

) {
fallbackPixels += 1;
}
}
expect(hasFallback, '256-colour text did not render as #d4d4d4').toBe(true);
expect(
fallbackPixels,
'256-colour text did not render as #d4d4d4',
).toBeGreaterThan(0);
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.
Comment thread
yiliang114 marked this conversation as resolved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Regression anchor: if the bounds guard in verify-capture.mjs is deleted, 256-color/truecolor cells produce fill="undefined" in the SVG. librsvg renders that as black. Black pixels have R=G=B~0, so 0 > 0x80 is false for all, fallbackPixels stays 0, and this assertion fails. Mutation confirmed by the PR author.

});

// SGR 30 maps to #1e1e1e — identical to the canvas BG — so black-foreground
Expand Down
Loading