Skip to content

Register the MCP server with Codex, and unblock the initializr suite - #5724

Merged
shai-almog merged 5 commits into
masterfrom
codex-mcp-registration
Sep 7, 2026
Merged

Register the MCP server with Codex, and unblock the initializr suite#5724
shai-almog merged 5 commits into
masterfrom
codex-mcp-registration

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Fixes the request in discussion #5700: Install in MCP Hosts now registers and unregisters a Codename One application's MCP server in Codex, instead of detecting Codex and asking the user to edit config.toml by hand. One file covers all three Codex clients - the ChatGPT desktop app, the CLI and the IDE extension share ~/.codex/config.toml.

How the TOML is edited

MCPToml edits the file as text rather than parsing and writing it back. It walks the document far enough to know where every table and key assignment begins and ends - tracking strings, multi-line strings, arrays, inline tables and comments, so a [ at the head of a line inside an array is never mistaken for a table header - and then rewrites only the byte range belonging to one server. Everything else survives exactly as the user left it: other servers, settings, comments, key order, formatting, line endings, a BOM. A parse-and-reserialize round trip could not promise that.

The other half of the promise is refusing. A document that is not valid TOML, or one that declares this server in a shape the editor does not rewrite - a dotted key, an inline table, an array of tables, or twice - is reported and left untouched. Losing a Codex configuration is a worse outcome than not registering. Server names and env keys are quoted when they are not bare keys: written bare, a dot in a name would silently become two nested tables instead of one server.

Registering twice replaces the entry rather than duplicating it, removing takes the server's env sub-table with it, and tables the user wrote out of order are consolidated.

Verification

Cross-checked against independent references, not only against itself:

  • 800 generated documents run through the editor and checked with Python's tomllib: the output parses, the entry is exact, every other key is unchanged, and removal restores the original. 0 failures.
  • Round-tripped with the real codex CLI (0.153.0): codex mcp list reads the entry we write with the right command/args/env, and the editor updates and removes an entry codex mcp add wrote while leaving its other server, [tui] and comments intact.
  • End-to-end through the real FileSystemStorage/JavaSE port against a temporary home: detect, register, re-register (byte-identical), unregister (file restored exactly, no temp file left).
  • 17 new unit tests; the full core-unittests suite is green, with SpotBugs, PMD and Checkstyle at zero.
  • Developer guide: Vale 0, LanguageTool 0, asciidoctor clean, structure/xref/link/snippet checks clean.

Generated projects

Every generated project already ships an authoring skill, but nothing in it told an agent that the running app is drivable - so an agent could only ever look at screenshots. A new reference covers the loop: serve from the simulator's MCP menu, register with one click, then ui_snapshot / ui_find / ui_set_text / ui_activate, with the release-build gate spelled out. Indexed from SKILL.md and AGENTS.md.

The initializr suite

Making that verifiable meant repairing scripts/initializr/javase, which has not compiled since #5591 added downloadProject to WebsiteThemeNative and left the simulator implementation behind. With the module building again its test suite runs, which surfaced three stale assumptions in GeneratorModelIntegrationBuildTest: the build client jar was written to the home root instead of .codenameone/, it was an empty placeholder when the mojo loads a class out of it, and the build stopped at compile while the css goal that produces theme.res is bound to process-classes. All six tests pass now, including the one that generates a real project, builds it on JDK 17 and verifies the localization bundles are baked into theme.res.

🤖 Generated with Claude Code

Codex was detected and then skipped: MCPClientRegistrar only knew how to edit a
JSON "mcpServers" object, so ~/.codex/config.toml was marked non-writable and
"Install in MCP Hosts" could neither add the entry nor remove it (discussion
#5700). One file covers all three Codex clients - the ChatGPT desktop app, the
CLI and the IDE extension share it.

MCPToml edits that file as TEXT rather than parsing and writing it back. It
walks the document far enough to know where every table and key assignment
begins and ends - tracking strings, multi-line strings, arrays, inline tables
and comments, so a "[" at the head of a line inside an array is never mistaken
for a table header - and then rewrites only the byte range belonging to one
server. Everything else survives exactly as the user left it: other servers,
settings, comments, key order, formatting, line endings, a BOM. A parse and
reserialize round trip could not promise that.

The other half of the promise is refusing. A document that is not valid TOML,
or one that declares this server in a shape the editor does not rewrite - a
dotted key, an inline table, an array of tables, or twice - is reported and
left untouched. Losing a Codex configuration is worse than not registering.
Server names and env keys are quoted when they are not bare keys: written bare,
a dot in a name would silently become two nested tables instead of one server.

Verified against the real thing, not only against ourselves. 800 generated
documents were cross-checked with Python's tomllib (output parses, the entry is
exact, every other key unchanged, removal restores the original), and the whole
cycle was round-tripped with the codex CLI: it reads what we write, and we
update and remove an entry it wrote without disturbing its neighbours.

The registrar's host table now carries a config format instead of a writable
flag, and the desktop menu names any host it could have written and did not, so
a refusal reaches the user rather than only the log.

Generated projects ship the pointer an agent needs: a new skill reference on
driving the RUNNING simulator over MCP - serve, register, then ui_snapshot /
ui_find / ui_set_text / ui_activate - indexed from SKILL.md and AGENTS.md. That
loop answers whether a flow BEHAVES right, which a screenshot cannot.

Making that verifiable meant repairing the initializr's javase module, which
has not compiled since #5591 added downloadProject to WebsiteThemeNative and
left the simulator implementation behind. With it building again the test suite
runs, which surfaced three stale assumptions in GeneratorModelIntegrationBuildTest:
the build client jar was written to the home root instead of .codenameone/, it
was an empty placeholder when the mojo loads a class out of it, and the build
stopped at "compile" while the css goal that produces theme.res is bound to
process-classes. All six tests pass now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T19:20:30.217988Z 23f0c43 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bb2fa5e42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CodenameOne/src/com/codename1/mcp/MCPClientRegistrar.java Outdated
Comment thread Ports/JavaSE/src/com/codename1/impl/javase/MCPDesktopMenu.java Outdated
Comment thread CodenameOne/src/com/codename1/mcp/MCPToml.java Outdated
Comment thread CodenameOne/src/com/codename1/mcp/MCPToml.java
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: No alerts found (report)
  • Paragraph capitalization: No paragraph capitalization issues (report)
  • LanguageTool: No grammar matches (report)
  • Image references: No unused images detected (report)

@shai-almog

shai-almog commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 9.21% (9146/99286 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.97% (47024/524433), branch 3.53% (1751/49663), complexity 3.51% (1858/52966), method 5.40% (1505/27866), class 10.85% (405/3731)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.21% (9146/99286 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.97% (47024/524433), branch 3.53% (1751/49663), complexity 3.51% (1858/52966), method 5.40% (1505/27866), class 10.85% (405/3731)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 184ms / native 246ms = 0.7x speedup
SIMD float-mul (64K x300) java 188ms / native 114ms = 1.6x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 88.000 ms
Base64 CN1 decode 84.000 ms
Base64 native encode 329.000 ms
Base64 encode ratio (CN1/native) 0.267x (73.3% faster)
Base64 native decode 257.000 ms
Base64 decode ratio (CN1/native) 0.327x (67.3% faster)
Image encode benchmark status skipped (SIMD unsupported)

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • build-hint-catalog: 0 findings (no issues)
    • build-hint-tools: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog

shai-almog commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 181 screenshots: 181 matched.
✅ JavaScript-port screenshot tests passed.

@shai-almog

shai-almog commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 148 screenshots: 148 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 318 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 78ms / native 7ms = 11.1x speedup
SIMD float-mul (64K x300) java 49ms / native 3ms = 16.3x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 159.000 ms
Base64 CN1 decode 95.000 ms
Base64 native encode 506.000 ms
Base64 encode ratio (CN1/native) 0.314x (68.6% faster)
Base64 native decode 228.000 ms
Base64 decode ratio (CN1/native) 0.417x (58.3% faster)
Base64 SIMD encode 50.000 ms
Base64 encode ratio (SIMD/CN1) 0.314x (68.6% faster)
Base64 SIMD decode 47.000 ms
Base64 decode ratio (SIMD/CN1) 0.495x (50.5% faster)
Base64 encode ratio (SIMD/native) 0.099x (90.1% faster)
Base64 decode ratio (SIMD/native) 0.206x (79.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 8.000 ms
Image createMask (SIMD on) 12.000 ms
Image createMask ratio (SIMD on/off) 1.500x (50.0% slower)
Image applyMask (SIMD off) 44.000 ms
Image applyMask (SIMD on) 27.000 ms
Image applyMask ratio (SIMD on/off) 0.614x (38.6% faster)
Image modifyAlpha (SIMD off) 27.000 ms
Image modifyAlpha (SIMD on) 23.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.852x (14.8% faster)
Image modifyAlpha removeColor (SIMD off) 27.000 ms
Image modifyAlpha removeColor (SIMD on) 24.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.889x (11.1% faster)

The Ant core build compiles against the Codename One runtime, not the JDK, and
StringBuilder.replace(int,int,String) exists in neither vm/JavaAPI nor
Ports/CLDC11 - so build-test (8) and javase-simulator-tests failed on a call
that compiled cleanly on a desktop. The splice now copies front to back with
append and substring. Verified the way CI does it, with
-bootclasspath ../cn1-binaries/CLDC11.jar, and with a negative control that
puts the replace() call back and fails.

Windows paths were wrong for the dotfile hosts. KnownClient.absolutePath
prefixed EVERY Windows entry with %APPDATA%, so Codex resolved to
~/AppData/Roaming/.codex/config.toml when CODEX_HOME is ~/.codex on every
platform - %USERPROFILE% on Windows. Claude Code had the same bug for
~/.claude.json. Both are silent: the config is never found, so the host is
never detected and nothing is ever written. The table now says which base each
host uses; only Claude Desktop, an installed application with a per user
directory of its own, keeps %APPDATA%. appDataPath now takes the home as an
argument instead of reading it back, so a path is a pure function of the home
it is resolved against - the asymmetry the new test caught first.

A multi-line string may legally end in four or five quotes, because the VALUE
itself may end in one or two. Consuming the first three as the delimiter left a
stray quote and refused a valid Codex configuration.

A container has to close with the delimiter it opened with. One depth counter
accepted `value = [}` as balanced, so a file that is not valid TOML was edited
anyway, against the one promise this editor makes. The walk now tracks the
closers it owes. Python's tomllib confirms both premises: it parses the
quote-run document and rejects all three mismatched-delimiter ones.

Removal no longer claims "no matching entries were found" when it does not know
that: a refusal produces the same empty list. It does NOT list the hosts that
were not updated the way Install does, because on removal that set is every
host the tool was never registered with, which would report the normal case as
a failure; the reason is in the code beside the message.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 747a9e2e56

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CodenameOne/src/com/codename1/mcp/MCPClientRegistrar.java Outdated
Comment thread CodenameOne/src/com/codename1/mcp/MCPToml.java Outdated
@shai-almog

shai-almog commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 12 screenshots: 12 matched.
✅ JavaSE simulator integration screenshots matched stored baselines.

@shai-almog

shai-almog commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 160 screenshots: 160 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 227 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 63ms / native 4ms = 15.7x speedup
SIMD float-mul (64K x300) java 61ms / native 4ms = 15.2x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 162.000 ms
Base64 CN1 decode 93.000 ms
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.286x (71.4% faster)
Image applyMask (SIMD off) 40.000 ms
Image applyMask (SIMD on) 27.000 ms
Image applyMask ratio (SIMD on/off) 0.675x (32.5% faster)
Image modifyAlpha (SIMD off) 30.000 ms
Image modifyAlpha (SIMD on) 176.000 ms
Image modifyAlpha ratio (SIMD on/off) 5.867x (486.7% slower)
Image modifyAlpha removeColor (SIMD off) 34.000 ms
Image modifyAlpha removeColor (SIMD on) 25.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.735x (26.5% faster)

…failure

Registering a second time reported failure. writeTomlEntry treats "the document
did not change" as "nothing was updated", which is right for a removal with no
entry to remove and wrong for a registration whose entry is already exactly
what would be written - the host IS registered. Install then listed Codex under
"Not updated" and pointed at a log that says nothing, on the ordinary path of
clicking Install twice. The check now answers per operation.

A neighbouring server declared with a root dotted key blocked everything. The
refusal was written for `mcp_servers = <value>`, after which TOML forbids a
later [mcp_servers.x] header - but it fired on any root key whose FIRST segment
was mcp_servers, so `mcp_servers.docs.command = "d"` refused both registration
and removal of an unrelated entry. Dotted keys leave mcp_servers defined by
dotted keys, and TOML explicitly allows a [table] header to add a sub-table to
one of those; only the whole-table assignment is fatal, and a dotted key naming
THIS server is already caught as a second declaration of it.

tomllib settles both boundaries: it parses `mcp_servers.docs.command = "d"`
followed by our table, and rejects the same document when the dotted key names
mcp_servers itself or this server. The cross-check now asserts that every
refusal on a valid document is justified by appending being illegal there.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5963bb3a15

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CodenameOne/src/com/codename1/mcp/MCPClientRegistrar.java Outdated
Deleting the config and renaming a staged file over it turned a symlinked
config - a common dotfiles arrangement - into a regular file, and reset the
file's mode to whatever the process umask said. Observed, not theorised: on the
previous commit a 600 symlink to ~/dotfiles/codex-config.toml comes back as a
644 regular file and the dotfiles source never sees the change. These files
carry other tools' API keys in their env blocks, so widening a hand-set 600 is
not cosmetic, and it happened on every write rather than on some unlucky one.

An existing config is now written through, which keeps the inode and therefore
keeps both the link and the mode. FileSystemStorage cannot read a link or copy
a mode - it has no API for either - so preserving the original file is the only
portable way to preserve them, and the suggestion to resolve the link or copy
the metadata explicitly cannot be implemented where this code has to live.

Nothing here was atomic to begin with, and the comment claiming it has gone:
rename cannot overwrite on every platform, so the old path deleted first and
had a window where the config was missing entirely. The staged sibling file
remains the recovery path - it holds the complete new content until the write
through succeeds - so the failure story is unchanged while the metadata story
is fixed. This applies to the JSON hosts too; ~/.claude.json holds tokens.

Verified end to end through the real JavaSE port: symlink still a symlink, mode
still 600, neighbouring server's secret env intact, no staging file left
behind, and the codex CLI reads the result and still reads it after removal.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d970fa8bff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CodenameOne/src/com/codename1/mcp/MCPClientRegistrar.java
Codex really is relocatable with CODEX_HOME - the review is right about the
behaviour - but the registrar cannot follow it. The Codename One runtime has no
System.getenv: it is absent from ../cn1-binaries/CLDC11.jar, the bootclasspath
the Ant core build compiles against, and from the java-runtime jar the bytecode
compliance check uses, so the call does not compile no matter what a desktop
JVM would do at runtime. Wiring it up would mean a desktop port, which does
have an environment, handing it to core through new public API, which is a
bigger decision than a Codex writer should make on its own.

Worth recording how nearly this went the other way: javap on either jar reports
a getenv that core cannot call, because it resolves java.lang.System from the
JDK rather than from the jar on the classpath. Only javac -bootclasspath tells
the truth, and it is what caught this after the plumbing was already written.
The note in the code says so, so the next reader does not repeat the check and
reach the wrong answer.

The affected user is told instead: the guide now says to add the entry by hand
when CODEX_HOME has moved the configuration, and the code records what such a
machine sees - Codex not detected at all, or a stale ~/.codex updated if one
survived the move.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@shai-almog
shai-almog merged commit 9abfaa2 into master Sep 7, 2026
44 checks passed
@shai-almog
shai-almog deleted the codex-mcp-registration branch September 7, 2026 01:49
@shai-almog

shai-almog commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

@shai-almog

shai-almog commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 143 screenshots: 143 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 1482 seconds

Build and Run Timing

Metric Duration
Simulator Boot 75000 ms
Simulator Boot (Run) 0 ms
App Install 19000 ms
App Launch 3000 ms
Test Execution 466000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 78ms / native 4ms = 19.5x speedup
SIMD float-mul (64K x300) java 71ms / native 3ms = 23.6x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 183.000 ms
Base64 CN1 decode 124.000 ms
Base64 native encode 744.000 ms
Base64 encode ratio (CN1/native) 0.246x (75.4% faster)
Base64 native decode 398.000 ms
Base64 decode ratio (CN1/native) 0.312x (68.8% faster)
Base64 SIMD encode 54.000 ms
Base64 encode ratio (SIMD/CN1) 0.295x (70.5% faster)
Base64 SIMD decode 49.000 ms
Base64 decode ratio (SIMD/CN1) 0.395x (60.5% faster)
Base64 encode ratio (SIMD/native) 0.073x (92.7% faster)
Base64 decode ratio (SIMD/native) 0.123x (87.7% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 8.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.250x (75.0% faster)
Image applyMask (SIMD off) 38.000 ms
Image applyMask (SIMD on) 36.000 ms
Image applyMask ratio (SIMD on/off) 0.947x (5.3% faster)
Image modifyAlpha (SIMD off) 45.000 ms
Image modifyAlpha (SIMD on) 34.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.756x (24.4% faster)
Image modifyAlpha removeColor (SIMD off) 41.000 ms
Image modifyAlpha removeColor (SIMD on) 39.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.951x (4.9% faster)

@shai-almog

shai-almog commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 149 screenshots: 149 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 1696 seconds

Build and Run Timing

Metric Duration
Simulator Boot 63000 ms
Simulator Boot (Run) 0 ms
App Install 25000 ms
App Launch 4000 ms
Test Execution 495000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 76ms / native 4ms = 19.0x speedup
SIMD float-mul (64K x300) java 98ms / native 3ms = 32.6x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 215.000 ms
Base64 CN1 decode 103.000 ms
Base64 native encode 429.000 ms
Base64 encode ratio (CN1/native) 0.501x (49.9% faster)
Base64 native decode 337.000 ms
Base64 decode ratio (CN1/native) 0.306x (69.4% faster)
Base64 SIMD encode 50.000 ms
Base64 encode ratio (SIMD/CN1) 0.233x (76.7% faster)
Base64 SIMD decode 47.000 ms
Base64 decode ratio (SIMD/CN1) 0.456x (54.4% faster)
Base64 encode ratio (SIMD/native) 0.117x (88.3% faster)
Base64 decode ratio (SIMD/native) 0.139x (86.1% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 9.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.333x (66.7% faster)
Image applyMask (SIMD off) 54.000 ms
Image applyMask (SIMD on) 28.000 ms
Image applyMask ratio (SIMD on/off) 0.519x (48.1% faster)
Image modifyAlpha (SIMD off) 31.000 ms
Image modifyAlpha (SIMD on) 27.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.871x (12.9% faster)
Image modifyAlpha removeColor (SIMD off) 32.000 ms
Image modifyAlpha removeColor (SIMD on) 26.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.813x (18.8% faster)

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.

1 participant