Introducing a new way to review your PRs.

Read the announcement

imputnet / helium

Private, fast, and honest web browser

View on GitHub

17 documents · Updated Nov 23, 2026

docs / platform-patch-maintenance

Platform patch maintenance

Platform patch maintenance keeps Helium's ordered Chromium changes usable as upstream source revisions move. The workflow joins the shared Helium stack with platform-owned patches for one refresh session, preserves product behavior during conflict resolution, then separates the stacks before validation.

Maintenance model

Patch ownership

The patch stack is an ordered change set that turns Chromium into Helium. Shared patches carry Helium browser behavior and product changes. Platform patches carry platform-owned changes. A refresh uses one working view to expose conflicts between these owners, but it must return each change to its original stack.

The shared series is grouped by product area. Core patches cover browser behavior and services. Settings patches expose user controls. UI patches shape the browser frame and controls. Privacy, search, sync, component, and web push patches connect related browser and settings contracts. The order in patches/series is part of these relationships.

The current series also treats persistent pins and browser layout as linked product areas. Core pin patches keep pinned tabs shared across normal windows, restorable, hibernatable, and safe to navigate. UI layout patches expose classic, compact, vertical, and dynamic layouts, plus frameless mode and optional native frame materials. These features cross browser state, settings, commands, resources, and layout, so a refresh must preserve the whole contract rather than only the changed source hunk.

The current series keeps component updates behind Helium service access and permits only the supported bundled components. It also disables the Reading Mode omnibox chip and removes the History page sync promotion. These changes are small user-facing contracts, so an upstream refresh must retain them rather than treat clean patch application as sufficient.

References: patches/series• L143-187 patches/series• L191-194 patches/series• L243-256 patches/series• L352-387 patches/…/pin-sync.patch• L195-207 patches/…/context-menu.patch• L135-164 patches/…/native-frame-materials.patch• L43-64

Chromium revision anchor

Every refresh targets the Chromium source version in chromium_version.txt. That value anchors source preparation and patch validation. revision.txt identifies the Helium patch level and does not replace the Chromium source anchor.

The source checkout, shared series, and platform series must use the same Chromium revision before the refresh is complete. Otherwise the refresh can describe a tree that is different from the tree used to build Helium.

References: chromium_version.txt• L1 revision.txt• L1

Source checkout

The prepared Chromium source tree is the common working view for patch refresh and validation. Checkout rules also set the dependency layout that the build expects. A source path change can therefore affect both patch context and build inputs.

Prepare the source tree with the expected checkout environment before refreshing patches. A result is meaningful only when the refresh tree matches the tree used for validation and build work.

References: utils/depot_tools.patch• L1-67

Update workflow

Platform stack preparation

Maintenance starts with the platform source tree at the same Chromium revision as the shared Helium stack. The updater then creates a temporary combined series so one Quilt session can expose conflicts between shared and platform changes.

The workflow follows this order:

  1. Select the target Chromium revision.
  2. Prepare the platform source tree.
  3. Save the platform series and prepend the shared series.
  4. Apply and refresh the combined series in one Quilt session.
  5. Separate the shared and platform series.
  6. Run structural and applicability checks.

The combined series is temporary. It gives conflict resolution one source-tree view without changing ownership of the patches.

This diagram shows how the two owners share one refresh session and then return to separate series.

flowchart LR
    A[Chromium revision] --> B[Prepared platform tree]
    C[Shared Helium series] --> D[Temporary combined series]
    E[Platform series] --> D
    B --> F[Quilt refresh session]
    D --> F
    F --> G[Separated shared and platform series]
    G --> H[Validation]

References: devutils/update_platform_patches.py• L33-54 devutils/update_platform_patches.py• L197-215

Stack merge

devutils/update_platform_patches.py provides the temporary merge. Its merge command saves the platform order, copies the shared series into the platform patch area, and writes one order with shared patches first.

Run it with the platform patch directory:

python3 devutils/update_platform_patches.py merge /path/to/platform/patches

The saved series.orig, series.prepend, and series.merged files hold the session state. Keep them until the source-tree refresh is complete.

References: devutils/update_platform_patches.py• L27-54 utils/patches.py• L153-198

Source-tree refresh

Refresh a patch only after the source tree expresses the intended Helium behavior on the new Chromium revision. Resolve conflicts by preserving the product contract instead of accepting the nearest upstream context.

Review affected changes as behavior groups:

  • Browser controls must keep their command IDs, feature gates, preferences, and visible actions aligned.
  • Service and component access must keep consent, update URLs, allowed component identities, and status messages aligned.
  • Search, address-bar, sync, privacy, web push, settings, and layout changes must preserve the contract between user controls and browser services.
  • Persistent pin changes must keep the profile pin list, window copies, session restore data, hibernation rules, split state, drag results, and navigation behavior aligned.
  • Layout changes must keep preferences, commands, settings labels, localized resources, frame support, vertical-tab placement, and zen-mode visibility aligned.
  • Canvas noise must keep its feature declaration, flag entry, and renderer behavior aligned. The uBlock component exception must keep extension settings, management exposure, and the settings UI consistent.
  • Small upstream-facing changes must remain intentional. The Reading Mode chip stays disabled, the History page sync promotion stays hidden, and component updates remain limited by Helium service access.

A patch can apply cleanly while one related contract is lost. Treat each affected group as one product change during conflict resolution, then inspect the upstream source that supplied the new context.

References: patches/…/lazy-session-restore.patch• L15-51 patches/…/lazy-session-restore.patch• L203-240 patches/…/pin-sync.patch• L195-207 patches/…/pinned-url.patch• L65-100 patches/…/sync-drags.patch• L227-300 patches/…/sync-splits.patch• L225-275 patches/…/core.patch• L227-238 patches/…/zen-mode-wiring.patch• L49-70 patches/…/zen-mode.patch• L286-334 patches/…/canvas.patch• L37-80 patches/…/ublock-show-in-settings.patch• L1-16 patches/…/component-updates.patch• L25-50 patches/…/component-updates.patch• L140-207 patches/…/disable-reading-mode-omnibox-chip.patch• L7-11 patches/…/remove-history-sync-promo.patch• L5-14 patches/…/disable-actions-for-browser-commands.patch• L1-12 patches/…/web-push-service.patch• L1-80

Stack separation

Run the updater's unmerge command after the source-tree refresh. It uses the saved series files and the merged order to move shared-owned patches back to patches/ and write the remaining platform-owned order to the platform stack.

python3 devutils/update_platform_patches.py unmerge /path/to/platform/patches

Complete unmerge before removing the temporary series files. The updater restores series comments and keeps new entries in the correct owner block.

References: devutils/update_platform_patches.py• L95-194

Validation workflow

Source boundary checks

Source boundary checks keep the prepared tree consistent with files that Helium removes before distribution. An upstream revision can move or rename a resource or source path. Review the cleanup boundary when source layout or checkout rules change.

References: utils/prune_binaries.py• L18-19 utils/prune_binaries.py• L159-178 utils/prune_binaries.py• L206-259

Structural checks

Structural checks confirm that each patch series is complete and readable. devutils/check_patch_files.py checks that listed patches exist and parse. It also finds duplicate entries and patch files that are not listed.

Run the check for the shared stack after unmerge. Run the matching check in the platform repository for the platform stack. A clean shared series does not prove that the platform series is complete.

python3 devutils/check_patch_files.py

References: devutils/check_patch_files.py• L7-17 devutils/check_patch_files.py• L50-112 devutils/check_patch_files.py• L115-136

Applicability checks

Applicability checks show whether the ordered patches still match the target Chromium source. The validator can use a clean local source tree or fetch revision-matched files from Chromium and its dependency repositories.

Use local mode when the exact clean platform source is available. Use remote mode when revision-matched source files are sufficient:

python3 devutils/validate_patches.py --local /path/to/clean/chromium/src
python3 devutils/validate_patches.py --remote

The validator checks patch application. It does not prove that a platform build succeeds or that browser behavior remains correct after conflict resolution.

References: devutils/validate_patches.py• L7-11 devutils/validate_patches.py• L386-403 devutils/validate_patches.py• L406-483 devutils/validate_patches.py• L553-607 devutils/validate_patches.py• L643-705

Change checklist

When these files or sections are changed, remember to consider these:

  • When chromium_version.txt changes, align the platform source revision and run applicability checks against that revision.
  • When patches/series or a patch path changes, preserve owner boundaries and dependency order in the temporary combined series.
  • When a patch is added, renamed, or removed, update the owning series and check both stacks for missing or unused entries.
  • When persistent pin patches change, check the shared pin list, per-window copies, session restore data, hibernation and close behavior, split metadata, drag completion, and outside-origin navigation together.
  • When browser layout or frameless-mode patches change, check the preference types, command IDs, settings allowlist, localized strings, layout state, and frame visibility rules together.
  • When component-update behavior changes, keep service consent, schema acceptance, update URL selection, allowed component identities, and status text aligned.
  • When a feature is disabled or a promotion is removed, check both the feature or handler decision and the user-visible surface that consumes it.
  • When a patch changes code registration, generated resources, or a protocol field, check that build targets, generated inputs, and both sides of the contract still agree.
  • When utils/depot_tools.patch changes, prepare a fresh source tree and confirm that dependency and sysroot paths match the build layout.
  • When utils/prune_binaries.py or the Chromium revision changes, compare every cleanup path with the new source tree.

Important failure modes

TriggerConsequenceGuard
The platform tree and chromium_version.txt use different revisions.Validation describes a source tree different from the build tree.Align both revisions before merge and validate against a clean tree.
Temporary series files are removed before unmerge.Shared and platform ownership cannot be restored safely.Run unmerge before cleanup.
A new, renamed, or deleted patch has no matching series update.The build omits a change or structural checks report an unused file.Update the owning series and check both stacks.
A patch is refreshed after a conflict without restoring its product contract.The patch can apply while browser, service, component, or settings behavior silently changes.Review the affected contract group after refresh.
Pin state is refreshed without its session or profile-list contract.A pin can lose its identity after restart or become different across windows.Check pin IDs, pinned URLs, session data, and profile pin storage together.
Deferred restore and pin hibernation rules are refreshed independently.A hibernated pin can load at the wrong time or restore the wrong page.Review restore load policy, activation return behavior, and close handling as one flow.
Split or drag changes update one window but not the shared pin order.Other windows can show stale pins or stale split layout.Check drag completion, split updates, reconciliation, and ordering together.
A layout preference or command changes without its settings or resource entry.The user can select a layout that does not persist or has no valid UI label.Trace the preference, command, settings, localization, and layout consumers.
A platform-gated frame feature loses its platform guard.Unsupported platforms can expose a setting that has no working frame behavior.Keep feature availability, settings visibility, and platform support checks aligned.
Component updates ignore service consent or schema state.Components can update outside the intended Helium service policy or fail in a misleading way.Check access gating, URL selection, allowed identities, and status text together.
A feature disablement is lost during an upstream refresh.Reading Mode or History UI can show a Chromium promotion that Helium removed.Recheck the feature default or handler decision after refresh.
The shared stack passes checks but the platform stack is not checked.A platform patch can be missing, duplicated, or unreadable when the build starts.Run structural checks for both stacks after unmerge.

Key files

FileWhy to read it
devutils/update_platform_patches.pyDefines the temporary merge and unmerge boundary between shared and platform patch owners.
patches/seriesShows the shared patch order and the product groups that shape a Helium build.
utils/patches.pyDefines common series parsing and patch-directory merge behavior.
devutils/check_patch_files.pyDefines structural checks for patch files and series entries.
devutils/validate_patches.pyDefines local and remote source applicability checks.
utils/prune_binaries.pyDefines the source cleanup boundary used before distribution.
chromium_version.txtAnchors the Chromium source revision for preparation and validation.
patches/helium/core/pins/pin-sync.patchShows the profile-wide pin contract and its cross-window reconciliation model.
patches/helium/core/pins/pinned-url.patchShows how persistent pins keep a target URL while allowing intentional navigation outside the pin.
patches/helium/core/lazy-session-restore.patchShows the deferred loading contract used by session restore and hibernated tabs.
patches/helium/ui/layout/core.patchShows the shared browser layout state and vertical-tab preference contract.
patches/helium/ui/layout/zen-mode.patchShows the frameless-mode visibility and reveal behavior.
patches/helium/ui/native-frame-materials.patchShows the platform-gated frame material setting and support boundary.
patches/helium/core/noise/canvas.patchShows the feature and flag contract for canvas fingerprinting protection.
patches/helium/ui/ublock-show-in-settings.patchShows the exception that exposes a bundled component in extension settings.
patches/helium/core/component-updates.patchShows how component updates follow Helium service policy and component allowlists.
patches/helium/core/disable-reading-mode-omnibox-chip.patchShows a small upstream feature change that must survive a patch refresh.
patches/helium/core/remove-history-sync-promo.patchShows a user-facing Chromium promotion removed by Helium.