Skip to content

Build and dependencies updates - #9020

Draft
limzykenneth wants to merge 13 commits into
processing:mainfrom
limzykenneth:build-update
Draft

Build and dependencies updates#9020
limzykenneth wants to merge 13 commits into
processing:mainfrom
limzykenneth:build-update

Conversation

@limzykenneth

Copy link
Copy Markdown
Member

This updates various build and dependencies with major points listed below (these may change over time and will be updated, see edit history for previous versions):

  • Migrate build from Rollup to Rolldown
  • Upgrade Vite and Vitest to latest version
  • Migrate from Webdriverio to Playwright in Vitest browser mode
  • More to come...

Please do test out any latest build with the continuous release CDN link below and report any issues with build, test, or bugs.

@Vaivaswat2244

Vaivaswat2244 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

vitest.config.js only applies the SwiftShader software-rendering Chromium flags when process.env.CI is set:

provider: playwright({
              capabilities: process.env.CI
                ? {
                    'goog:chromeOptions': {
                      args: [
                        '--no-sandbox',
                        '--headless=new',
                        '--enable-unsafe-webgpu',
                        '--use-vulkan=swiftshader',
                        '--use-webgpu-adapter=swiftshader',
                        '--use-angle=vulkan'
                      ]
                    }
                  }
                : undefined
            }),

So CI renders text through SwiftShader while a local run uses whatever hardware-accelerated backend is on the machine. The 3 failing baselines were captured on the hardware path and were never regenerated for SwiftShader. that's the mismatch, not anything about the Rolldown/Playwright migration itself.

Ruled out a couple of alternatives before landing on that: (context: pixelmatch algo )

  • Not simple AA/line-shift noise — ran the diffs through the clustering algo already in visualTest.js: significantDiffPixels came out at 160 and 257 against the 40px threshold, way past what tolerance-tuning could reasonably absorb.
  • Not font-hinting — added --font-render-hinting=none --disable-lcd-text on top of the CI flags and reran under CI=true: diff numbers came back byte-identical, no change at all.
  • Not font substitution — all 3 failing tests load the same bundled test/unit/assets/Inconsolata-Bold.ttf via loadFont(), not an OS-resolved font like 'monospace'/'serif', so it's the same font bytes locally and in CI either way.

Plan:
Firstly, I guess we should drop the process.env.CI ternary so the SwiftShader args always apply, local and CI alike keeps future baselines reproducible for every contributor instead of tied to one machine's renderer. And then we have to regenerate just the 3 affected typography screenshots under that path.

The screenshots should be regenerated because in order to incorporate the build updates, we either have to update the thresholds in the matching algo checkMatch which might some flase negatives in tests, or we can regenrate baselines to match CI's standard everywhere (these are only 3 tests).

cc @davepagurek

@limzykenneth

Copy link
Copy Markdown
Member Author

For the SwiftShader flag, I think it should either not be used or only be used in CI. Typical users don't run their browsers with that flag enabled and us testing with it enabled can potentially cause false positives, it is currently there guarded behind the CI flag because it's needed to run on the GitHub Actions image since there's no GPU attached to the images.

The screenshots of what's rendered vs what can be seen locally is a bit concerning as well though.

@Vaivaswat2244 Vaivaswat2244 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After some more digging, and some more runs using CI = true I think this has nothing to do with SwiftShader. Playwright is using chromium which drives its own Chromium, This browser difference in baselines and these images are causing the failures. This is a headless vs headed browser problem. Making browser and channel as chrome, all the tests are passing.

Comment thread vitest.config.js Outdated
} : undefined
provider: playwright({
capabilities: process.env.CI
? {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

adding channel: chrome and browser : chrome should fix this

provider: playwright({
              launchOptions: process.env.CI
                ? { 
                    channel: 'chrome',
                    args: [
                      '--headless=new',
                      '--no-sandbox',
                      '--enable-webgl',
                      '--use-gl=angle',
                      '--use-angle=swiftshader-webgl',
                      '--enable-unsafe-swiftshader'
                    ]
                  }
                : { channel: 'chrome' }
            })

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems to have cleared it now. It won't be possible to use browser: 'chrome' as that is not a supported browser and it requires contributors to have Chrome installed which not everyone may want to. Using channel: 'chromium' seems to be the recommendation from Playwright and Google Chrome team regarding something closest to real Chrome in a headless environment.

Comment on lines 337 to 354
@@ -346,6 +352,8 @@ function transformBinaryOrLogical(node, state, ancestors) {
},
};
node.arguments = [node.right];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@davepagurek Almost every part once migrated over to zimmerframe seems to be working except this part which causes some kind of NaN problem. Can you have a look when you are able? I'm not super familiar with how to debug strands and shaders.

@Vaivaswat2244

Copy link
Copy Markdown
Contributor

@limzykenneth — since this swaps WebdriverIO for Playwright, it also clears the
blocker that closed #8853: the Node 24 runner pulled Chrome 148 and WebdriverIO
couldn't fetch a matching driver. Playwright manages its own browser, so that
failure mode goes away. Should close #8674 as well

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.

2 participants