Skip to content

ci: run the macOS write watch and register context tests under Rosetta - #3962

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
ahir061:ci/macos-rosetta-tests
Nov 4, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
ahir061:ci/macos-rosetta-tests

Conversation

@ahir061

@ahir061 ahir061 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What

Relinked titles run on Apple silicon as x86-64 code under Rosetta (--macos --to-rosetta, USAGE.md), but CI runs the write watch tests there only as arm64 (macos-15) and the register context tests only on macos-15-intel and Linux. This adds x86_64 builds of both on macos-15, using the -DCMAKE_OSX_ARCHITECTURES=x86_64 configuration BUILD.md documents for local runs, and installs Rosetta first in case the runner image lacks it.

New jobs: register-context (macos-15, Debug, x86_64), register-context (macos-15, Release, x86_64) and write-watch (macos-15, x86_64). The existing jobs are unchanged: CMAKE_OSX_ARCHITECTURES is empty for them, which keeps the host architecture.

Tested

  • MacBook Air M3, macOS 26.0.1, AppleClang 17.0.0, CMake 4.4.4, under Rosetta (file reports Mach-O 64-bit executable x86_64), with the same commands as the new jobs and --repeat until-fail:3:
    • write watch, Release: 6/6 pass.
    • register context, Release and Debug: 3/3 pass each.
  • The matrix expands to the existing combinations plus the three new ones.
  • tools/check_conventions.py --base main passes.
  • Both jobs run on every pull request, so this PR's checks run the new jobs on GitHub's macos-15 image.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (CI only)
  • Depends on: none
  • AI-assisted: yes

@github-actions github-actions Bot added the ci .github label Oct 11, 2026
@TideOPL

TideOPL commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Looks good. The three new jobs (register-context (macos-15, Debug|Release, x86_64) and write-watch (macos-15, x86_64)) ran on this PR and pass, and the existing combinations are unchanged. Covering Rosetta in CI makes sense, since that's how relinked titles run on Apple silicon.

AI-assisted: yes. Written with AI assistance (Claude Code); I reviewed it.

@thuanquang

Copy link
Copy Markdown
Contributor

Tested on macOS 27.0.1 (Apple silicon, Rosetta 2), AppleClang 21.0.0, CMake 4.4.4, with this PR merged into main at c2565f0. It merges cleanly, both jobs keep the needs: eligibility / if: gating from #4405, and test_check_conventions_ci_gate.py and check_conventions.py --base origin/main pass on the merge.

Same commands as the three new jobs (default generator, -DCMAKE_OSX_ARCHITECTURES=x86_64, ctest --output-on-failure --repeat until-fail:3 --no-tests=error):

Job Result
register-context, Debug, x86_64 3/3 pass
register-context, Release, x86_64 3/3 pass
write-watch, Release, x86_64 8/8 pass (the suite has 8 tests on current main)

file reports Mach-O 64-bit executable x86_64 for all three test binaries.

To look for Rosetta-only flakiness, each build also ran --repeat until-fail:100 serially and --repeat until-fail:50 -j8: 2,100 test runs, no failures. Slowest single run: 0.10 s for register context; write_watch_threads 0.37 s serially and 1.82 s under -j8.

This adds a macOS 27 result to the macOS 26.0.1 runs in the description and the macos-15 runner results.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 17, 2026
ycarogabriel-lgtm added a commit to ycarogabriel-lgtm/AnyPS5 that referenced this pull request Oct 18, 2026
…ite watch and register context tests under Rosetta (@ahir061)

Taken from the open upstream pull request so the macOS integration branch carries every piece of the port that is already under review, instead of re-implementing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ahir061
ahir061 force-pushed the ci/macos-rosetta-tests branch from fb15383 to 1c3116c Compare October 19, 2026 08:22
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
ycarogabriel-lgtm added a commit to ycarogabriel-lgtm/AnyPS5 that referenced this pull request Oct 19, 2026
…context tests under Rosetta (@ahir061)

This branch already carried an earlier head of this PR; the author has pushed newer commits since, and this merge brings the branch up to them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@MarcZX10 MarcZX10 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.

The Rosetta matrix changes are supported by the passing macOS x86_64 jobs and repeated author-reported runs. I manually compared the shared workflow hunks with #6044: its current changes relocate path-filter entries around lines 70–85, while this PR adds the matrix entries and commands near lines 358–429, so I found no same-hunk dependency.

I’m requesting one contribution-template correction before approval. The current .github/pull_request_template.md includes Fixes:, Unblocks:, and GPUs tested: checklist lines, but this PR body omits all three. Please complete them (none, none, and n/a, respectively) so the description follows the repository’s current template. The conventions workflow passed, but it did not flag these missing fields.

@fogydes

fogydes commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Small, verifiable change: two macOS x86_64 matrix rows added with -DCMAKE_OSX_ARCHITECTURES=x86_64 and a softwareupdate --install-rosetta step in the register-context job — read the full diff hunk-by-hunk. [verified]

One suggestion before it merges: both new matrix entries still run inside jobs with timeout-minutes: 5, and the Rosetta install step is a network download that regularly takes 2–6 minutes on GH runners — on its own it can eat most or all of the budget, and it shares the 5 minutes with fetch + configure + build + --repeat until-fail:3 ctest. Consider raising the timeout for those jobs (or a separate step-group) so the first flaky Rosetta download doesn't turn every first Acceptance run red.

Envelope: 4,631 commits behind base 4866297fcf, 1 ahead, merges cleanly against 1e20650e84. [verified]

@maximilianfv

Copy link
Copy Markdown
Contributor

Tested on Apple M1 Pro, macOS 27.0.1 (native arm64, and x86_64 under Rosetta 2)

AppleClang 21.0.0, CMake 4.4.4. Head 5c3e28341 applies cleanly to main at 25b744db4a. I ran the commands from the new jobs on two source trees. The first was main at 25b744db4a, using the files these two standalone projects compile and include. The second was mugurc's macOS series (27e968974) merged with main at 1e20650e84, with other open macOS fixes. The same commands were used each time; only the build directory changed. The cmake -S paths, the target names and the test names all still exist on current main.

write watch, Release register context, Debug register context, Release
Without this PR (current macos-15 job, no architecture set) arm64 binary, 10/10 pass not run on macos-15 not run on macos-15
With this PR, -DCMAKE_OSX_ARCHITECTURES=x86_64 x86_64 binary (file), 10/10 pass x86_64 binary, 3/3 pass x86_64 binary, 3/3 pass

All runs used --repeat until-fail:3, and both source trees gave the same results. With the empty value that the PR now passes for the existing rows (-DCMAKE_OSX_ARCHITECTURES=), write watch still builds as arm64 and passes 10/10 in both trees, so those rows keep the host architecture as the PR says.

Two notes on the PR text, neither of which blocks it:

  • main now has 10 write watch tests (collect to threads), not the 6 listed under Tested.
  • On current main the eligibility gate runs these jobs only when a PR touches their test paths or libc, or edits the job, not on every PR. This PR edits both jobs, so its own checks still ran the three new jobs, and they pass.

Not checked here: the softwareupdate --install-rosetta step, because Rosetta was already installed on this machine. I also did not test the empty-architecture configure on ubuntu-latest.

AI-assisted: yes (Claude Code applied the PR, ran the tests and wrote this report).

@THEMANnt THEMANnt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed 5c3e283416dcec80839058b85dfedf5904397165 against author merge base 4866297fcfaa56b53d0ff5b21e4909bed1d89ffd.

Approve. No actionable findings in the CI matrix patch.

Reviewed the complete workflow changes: existing native matrix combinations remain, while macos-15 x86_64 Debug/Release register-context and x86_64 write-watch combinations are added. Each new combination installs Rosetta, configures the x86_64 architecture explicitly and receives the longer 15-minute timeout. Empty architecture values retain the existing native configuration path.

Validation: parsed the exact YAML and inspected matrix entries. Hosted Build 40095103764 successfully executed all three added jobs: write-watch 120875607837, register-context Debug 120875607845 and Release 120875607865; their logs show actual passing CTest runs on the PR merge checkout. Conventions and whitespace passed. This older registration CLI rejects --scripts, so that check is not reported as passing. No local macOS execution or full application/game test was performed.

@babyhuey

Copy link
Copy Markdown
Contributor

Windows run of this head 5c3e283416d, merged onto main 4b1a9a3b2f5 (clean merge, local only), with the selection CI's skipped Windows product job uses: Windows 11, Ryzen 7 5800X, RTX 3080, WinLibs GCC 15.2, Release, BUILD_TESTING=ON. The tree was configured fresh after the merge, then select_tests.py select / ninja -f select.ninja selected / --target libs / select_tests.py ctest --parallel 4 --timeout 120.

  • Selected 2,458 tests: 1,761 pass, 2 fail, pr_overlap_encoding and agc_host_import_cut_lifetime (agc_host_import_cut_lifetime fails on Windows since the merge of #9159 #10746), which also fail on 4b1a9a3b2f5 itself on this machine, 695 skip. No failures from this PR.
  • guest_fopen_errors skips itself here because creating symbolic links needs Developer Mode or administrator rights on this machine; it does the same on main, and CI's Windows runners have the rights.

AI-assisted: yes (Claude Code)

@oneandonlydean oneandonlydean self-assigned this Oct 27, 2026
@blawesom

Copy link
Copy Markdown
Contributor

Static review plus local checks on the changed test project (CachyOS Linux, GCC 16.2.1, Ninja, Release). No findings.

What I checked

  • The matrix idiom is correct: single-value architectures: [''] baseline plus include extras gives exactly the existing ubuntu-latest/macos-15-intel combos an empty architectures (so -DCMAKE_OSX_ARCHITECTURES= is inert) and adds macos-15 arm64-runner × {Debug,Release} for register_context and the macos-15 × x86_64 pair for write_watch. Nothing silently drops a coverage cell — cross-checking against the current matrix, +3 jobs register_context, +2 jobs write_watch, every original os/configuration combination kept.
  • -DCMAKE_OSX_ARCHITECTURES=${{ matrix.architectures }} long line expands cleanly; an empty override is a no-op as noted above.
  • sudo softwareupdate --install-rosetta --agree-to-license is correctly scoped if: matrix.architectures == 'x86_64' so Intel runners and Linux never run it (it would fail there).
  • The timeout-minutes: ${{ matrix.architectures == 'x86_64' && 15 || 5 }} expression: the Rosetta-install step is the only new pre-build work, and compiled-under-Rosetta x86_64 on an ARM host is plausibly 3× slower than native — 15 vs 5 is a reasonable margin. The only real risk I see is whether 15 minutes is actually enough for the Debug register_context build under Rosetta emulation on a full cold cache; if a run times out, bump this rather than narrow the matrix.

Local smoke check (this is the changed build path' template — same CMake project, not the Rosetta invocation itself):

cmake -S core/libs/tests/register_context -B build/rc -DCMAKE_BUILD_TYPE=Release
cmake --build build/rc --parallel
ctest --test-dir build/rc --output-on-failure --repeat until-fail:3 --no-tests=error

3/3 passed (0.01s total), --repeat until-fail:3 stable.

Not covered

The Rosetta-instruction path (architectures: x86_64 on macos-15 arm64) can only be exercised on a macOS arm64 runner with Rosetta installed — this machine is Linux/AMD, so that's the one thing worth watching on the first Actions run after merge. If the Debug register_context job is the only flaky one afterwards, the timeout is the first suspect.

@fogydes

fogydes commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Correction: The previous review comment (Oct 24) suggested raising the timeout for the new Rosetta matrix rows. Commit 5c3e283416 addressed this directly by making the timeout conditional (timeout-minutes: ${{ matrix.architectures == 'x86_64' && 15 || 5 }}), granting the Rosetta setup and execution 15 minutes while leaving native runners at 5 minutes.

Verdict: should-fix

Findings:

  1. check_conventions.py passes cleanly: ran python tools/check_conventions.py --base 4866297fcfaa56b53d0ff5b21e4909bed1d89ffd in a scratch worktree at head 5c3e283416; 0 findings. [verified]
  2. Clean merge-tree: git merge-tree --write-tree origin/main 5c3e283416 succeeds cleanly with exit code 0 (tree ba0e96de384d60008f8e368cd5e0a36b3305f0d0), despite being 10,163 commits behind base. [verified]
  3. In .github/workflows/build.yml, adding architectures: [''] baseline with targeted x86_64 matrix inclusions correctly isolates -DCMAKE_OSX_ARCHITECTURES=${{ matrix.architectures }} without disturbing the existing native ARM64 or Linux/Intel matrix jobs. [read-only]
  4. sudo softwareupdate --install-rosetta --agree-to-license is strictly guarded by matrix.architectures == 'x86_64', preventing invalid execution on Intel/Linux runners. [read-only]
  5. PR description template checklist gap (noted in @MarcZX10's review):
    • The checklist omits three lines from .github/pull_request_template.md:
      • - [ ] Fixes: none
      • - [ ] Unblocks: none
      • - [ ] GPUs tested: n/a
    • Adding these three lines to the PR description will satisfy AGENTS.md and clear the open review request. [read-only]
  6. Local test runs on M3/macOS 26.0.1 in the PR description are [author-reported].

Freshness envelope:

  • Head SHA: 5c3e283416dcec80839058b85dfedf5904397165
  • Base SHA: 4866297fcfaa56b53d0ff5b21e4909bed1d89ffd
  • Behind count: 10,163 commits behind origin/main (bb04a4f1ea)
  • Merge-tree: exit code 0, clean tree ba0e96de384d60008f8e368cd5e0a36b3305f0d0

Cross-PR ledger:

  • No merge-conflicting open PRs on .github/workflows/build.yml.

@MarcZX10 MarcZX10 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.

Re-checked — changes requested

The Rosetta matrix has passing hosted runs, but the PR description still misses required checklist fields and the branch is far behind current main.

What I ran

Rechecked exact PR head 5c3e283416dcec80839058b85dfedf5904397165, base 3fdd1f52e968c57d2b6890b11863f96aee0c11ce, and current upstream main 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5. The current-main merge preview is clean. Environment: Linux x86-64, Git and GitHub CLI; I did not build locally.

git diff --check 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5...refs/review/pr-3962-head
git merge-tree --write-tree 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5 refs/review/pr-3962-head
git rev-list --count 3fdd1f52e968c57d2b6890b11863f96aee0c11ce..9624d8c6bb9e96b7aa92b815f55690f69b0a88d5

Results

Check Result
Patch whitespace Pass
Merge preview on current main Clean
Base freshness Current main is 10,781 commits ahead of the PR base
Hosted Rosetta register-context Debug/Release and write-watch x86_64 jobs Pass on this exact head; the existing matrix jobs also pass
Hosted conventions, eligibility and labels Pass on this exact head
Hosted Linux and Windows product jobs Skipped
Shared workflow overlap with #12741 The overlap bot could not compare the shared file because #12741 conflicts with its base. I manually compared the hunks: this PR changes the register-context/write-watch matrix around lines 358–429; #12741 changes eligibility and adds edge-watch elsewhere. I found no same-hunk overlap. Recheck after syncing current main.
PR template checklist Fixes, Unblocks, and GPUs tested lines are absent from the description
Local build/tests Not run; the exact-head hosted matrix already exercises the added jobs
Unedited local command output
diffcheck-exit=0
0c9c8fc05e1a6fdb6d8464fc4f8bc7ad6d5b245b
merge-tree-exit=0
10781

Findings

Blocking

  • The PR description omits the required checklist entries Fixes, Unblocks, and GPUs tested. Please add none, none, and n/a respectively, as applicable to this CI-only change.
  • The PR base is 3fdd1f52e968, while current main is 9624d8c6bb9e. Although the merge preview is clean, the repository requires branches to be based on and kept up to date with current main; rebase or merge current main, then rerun the overlap/convention checks.

Non-blocking

  • The overlap bot could not compare .github/workflows/build.yml against #12741 because that PR conflicts with its base. My manual hunk comparison found separate workflow sections and no duplicate change; the overlap check should be refreshed after the branch is updated.

Sources

Not verified

I did not independently run a macOS/Rosetta host; the successful hosted matrix results and contributor runs are separate from local testing. The Linux and Windows product workflows were skipped.

To get this to a good state

Add the three checklist lines, update the branch onto current main, and rerun the overlap and convention checks. I will recheck the resulting head and the new hosted statuses.

@SHOnnay

SHOnnay commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Ran this on Apple M1, macOS 27.0.1 (26A434), AppleClang 21.0.0, CMake 4.4.5. Merged locally onto f911371 (merge clean); test binaries verified as x86-64 under Rosetta. Commands follow the workflow, with --repeat until-fail:3.

register-context Debug and Release: 3/3 passed in every repeat, on main and with the PR.

write-watch (Release, x86_64): configure fails on main and with the PR, with the same error:
CMake Error at CMakeLists.txt:42 (add_test): add_test given test NAME "write_watch_execute-fault" which already exists in this directory. (same for "write_watch_read-fault")
So the write-watch Rosetta row cannot be validated until that is fixed. This looks like the duplicate registration that #13220 targets, but I haven't confirmed that.

The diff looks correct as a workflow-only change. One detail: the description says these jobs run on every PR, but they are gated by changed files.

AI-assisted (Codex).

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@ahir061 Thanks for keeping this going. #13220 has now merged, so the duplicate write-watch registration is gone from this PR's way, and we've queued a fresh CI run on your current head to see the Rosetta cells on today's main.

One small thing that would help it land: the PR template's Fixes:, Unblocks: and GPUs tested: lines are still missing from the description. For a CI-only change like this, GPUs tested: n/a (CI only) is fine, and Fixes: / Unblocks: can say none or name the macOS x86_64 coverage gap it closes.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 14399 .github/workflows/build.yml L377, L411

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 13560 .github/workflows/build.yml
PR 13997 .github/workflows/build.yml

@ahir061
ahir061 force-pushed the ci/macos-rosetta-tests branch from 5c3e283 to 69eed07 Compare November 4, 2026 14:04
@oneandonlydean
oneandonlydean merged commit b611e63 into boykopovar:main Nov 4, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci .github

Projects

None yet

Development

Successfully merging this pull request may close these issues.