)]}'
{
  "commit": "9f2f03173b7fee860cc00d999857d09fa4a362e2",
  "tree": "6bbe0036d8044565f079e6e5629f0df8982e5376",
  "parents": [
    "dde1f1baee2bf2d634a97e17485dbdd54e1e73f9"
  ],
  "author": {
    "name": "Behdad Esfahbod",
    "email": "behdad@behdad.org",
    "time": "Tue Aug 04 23:08:39 2026 -0600"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Aug 04 23:08:39 2026 -0600"
  },
  "message": "[gpu] Fix coverage sign of the split-ray optimization (#6133)\n\n_hb_gpu_slug_single casts its horizontal ray leftward or rightward\ndepending on which side of the band\u0027s split point the fragment is on,\nand likewise for the vertical ray.  The crossing signs it accumulates\nare the same either way.\n\nBut over a closed contour the signed crossings of a line sum to zero,\nso counting the crossings on the left gives exactly the negative of\ncounting them on the right (clamp(0.5 + u) + clamp(0.5 - u) \u003d\u003d 1, so\nthis holds for the antialiased partial coverages too).  Whenever\nhLeftRay and vLeftRay disagree, xcov and ycov therefore came out with\nopposite signs, and _hb_gpu_calc_coverage\u0027s\n\n  abs (xcov * xwgt + ycov * ywgt) / (xwgt + ywgt)\n\nsubtracted the two estimates instead of averaging them.\n\nGlyph interiors were unaffected -- the min (abs (xcov), abs (ycov))\nterm floors the result there -- so this never showed as a hole.  It\nshowed as edges that antialias too light wherever both weights are\nnonzero and the two estimates differ.\n\nFlip the sign back after each loop.  With a CPU port of\n_hb_gpu_slug_single, comparing against plain Slug (rightward rays\nover the full curve list, which is what the sign convention in\n_hb_gpu_calc_coverage assumes), util/gpu/default-font.ttf at scale\n163 rendered at 107px had 1700 pixels differing by more than 0.05\nbefore this change, always too dark, and none differing by more than\n0.001 after -- the split optimization is now exact.\n\nSame fix in all four shading languages.  The GLSL was checked with\nglslc; the HLSL, MSL and WGSL edits are the same two statements and\nwere not machine-compiled.\n\nAssisted-by: Claude Opus 5 (1M context) \u003cnoreply@anthropic.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c7356fede500afe7d5a1cc765785d1981ca6807c",
      "old_mode": 33188,
      "old_path": "src/hb-gpu-fragment-glsl.hh",
      "new_id": "1db7066c7d3a1b74860be1ddecbe33d64e0980b5",
      "new_mode": 33188,
      "new_path": "src/hb-gpu-fragment-glsl.hh"
    },
    {
      "type": "modify",
      "old_id": "bfe2c93011e703fd61be35d84846610664211d81",
      "old_mode": 33188,
      "old_path": "src/hb-gpu-fragment-hlsl.hh",
      "new_id": "3ad54d183fc470b86eec912129669d956b512527",
      "new_mode": 33188,
      "new_path": "src/hb-gpu-fragment-hlsl.hh"
    },
    {
      "type": "modify",
      "old_id": "e30a50421435dbe09baf048bffd8cf15b2b8be0f",
      "old_mode": 33188,
      "old_path": "src/hb-gpu-fragment-msl.hh",
      "new_id": "83f04b14f820292082338554570685639f6b065c",
      "new_mode": 33188,
      "new_path": "src/hb-gpu-fragment-msl.hh"
    },
    {
      "type": "modify",
      "old_id": "e77698e5eadf513a907054e8b0cc589f3b324ba6",
      "old_mode": 33188,
      "old_path": "src/hb-gpu-fragment-wgsl.hh",
      "new_id": "3a8fa31d2f5b413e5d35cfe90317e9773662d1ee",
      "new_mode": 33188,
      "new_path": "src/hb-gpu-fragment-wgsl.hh"
    },
    {
      "type": "modify",
      "old_id": "23b14a0ba4bd8355491e2d9eaeb7ace23b1fec14",
      "old_mode": 33188,
      "old_path": "src/hb-gpu-fragment.glsl",
      "new_id": "734f136c372314be6e1951e83806870e3b4f7f53",
      "new_mode": 33188,
      "new_path": "src/hb-gpu-fragment.glsl"
    },
    {
      "type": "modify",
      "old_id": "a0c69d6cd89342acd2d3e506ac5e86cb6c8578ce",
      "old_mode": 33188,
      "old_path": "src/hb-gpu-fragment.hlsl",
      "new_id": "6ab728c8a327aee63dd2dfb8f08f46d5a90ae832",
      "new_mode": 33188,
      "new_path": "src/hb-gpu-fragment.hlsl"
    },
    {
      "type": "modify",
      "old_id": "bb7da496dbecb11b9175234a3feedf85b8bf7d2e",
      "old_mode": 33188,
      "old_path": "src/hb-gpu-fragment.msl",
      "new_id": "3f3220bbab855ef5f1d3fe204403136b466a93b1",
      "new_mode": 33188,
      "new_path": "src/hb-gpu-fragment.msl"
    },
    {
      "type": "modify",
      "old_id": "0fac0c384f9a3a957110c4e0d9caae6bd57a1a5c",
      "old_mode": 33188,
      "old_path": "src/hb-gpu-fragment.wgsl",
      "new_id": "ae9c1da41fc6dec3986250e6985d4fe4f05ee078",
      "new_mode": 33188,
      "new_path": "src/hb-gpu-fragment.wgsl"
    }
  ]
}
