Skip to content

Leave foreign libc errno constants residual - #1979

Merged
youknowone merged 1 commit into
mainfrom
fix/main-ci
Sep 26, 2026
Merged

youknowone merged 1 commit into
mainfrom
fix/main-ci

Conversation

@youknowone

@youknowone youknowone commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

A host libc errno value is not the target's. EAGAIN is 35 on macOS and 11 on Linux and wasm, so an opaque libc NamedConst stays a residual read instead of a folded ConstInt.

This answers the P1 on #1974.

Assisted-by: Grok

Summary by CodeRabbit

  • Bug Fixes
    • Constant folding no longer substitutes host libc errno values when target-specific values are unavailable, avoiding incorrect results across platforms.

A host libc value is not the target's. EAGAIN is 35 on macOS and 11
on Linux and wasm, so the fold is not baked into JIT artefacts.

Assisted-by: Grok
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d2be23b2-147e-4c9e-b7c3-2a76ee6976ad

📥 Commits

Reviewing files that changed from the base of the PR and between a39b6c0 and a077271.

📒 Files selected for processing (1)
  • majit/majit-translate/src/front/mir.rs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.


Walkthrough

The change removes the fallback that folded unresolved libc errno constants using host values. The documentation now states that unharvested errno constants remain residual because host values can differ from target values.

Changes

Constant folding

Layer / File(s) Summary
Constant-folding fallback
majit/majit-translate/src/front/mir.rs
The fallback that mapped libc errno names to host integer values is removed. Documentation states that unharvested errno constants remain residual. LLBC folds and harvested named-constant values remain the folding sources.

Priority: ⬆️ High

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to a0772

Unharvested errno constants remain residual rather than embedding host values in target artifacts; no actionable merge-blocking risk is identified.

Architecture Summary

Architecture risk: 🔵 Low · up to a0772

The change affects 1 system.

Changed systems: majit

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — majit (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in majit/majit-translate/src/front/mir.rs: The documentation now distinguishes harvested constants from unharvested libc errno constants and says opaque errno reads remain residual because host values can differ across targets.
  • observed — Modified behavior in majit/majit-translate/src/front/mir.rs: Removed the fallback that converted a named path through libc_integer_const; constants not resolved by LLBC folding or named-constant lookup are no longer folded through this path.
  • observed — Modified behavior in majit/majit-translate/src/front/mir.rs: Removed the private libc_integer_const and libc_errno_value helpers, including the libc path check and errno-name mapping that returned host libc values as integer constants.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: foreign libc errno constants remain residual instead of being folded.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 ast-grep (0.45.3)
majit/majit-translate/src/front/mir.rs

ast-grep timed out on this file


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks each errno sign
And leaves the host value behind
If no target value has been found
The constant stays unbound
LLBC folds lead the way
And harvested names hold their say

Comment @coderabbitai help to get the list of available commands.

@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: a077271228

ℹ️ 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".

@@ -9653,7 +9655,6 @@ impl<'a> Lowering<'a> {
return None;
}
named_const_fold_for_path(&gd.item_meta.name_path())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Lower libc errno reads with target constants

When a JIT candidate reads a foreign libc errno constant (for example, rsocket_rffi::error_is_would_block reads EAGAIN/EWOULDBLOCK), its opaque NamedConst initializer is not in the harvested folds, so this now returns None. resolve_place consequently emits a zero-argument FunctionPath for the constant, but there is no callable accessor registered for libc constants; the flowspace adapter rejects that path as "not registered in CallRegistry" and Skip-classifies the enclosing graph to the legacy walker. This avoids folding the host value, but it makes the affected target-specific interpreter paths non-JITtable rather than preserving them; provide a target-aware constant/read representation instead.

AGENTS.md reference: AGENTS.md:L29-L32

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown

🤖 Codex parity review

Static analysis of this diff vs the local RPython/PyPy sources (commit a077271).
Updated: 2026-09-26T12:59:06.857Z

Files in the reviewed diff
majit/majit-translate/src/front/mir.rs

Codex did not produce a report (exit 1). Last log lines:

warning: Codex could not find bubblewrap on PATH. Install bubblewrap with your OS package manager. See the sandbox prerequisites: https://developers.openai.com/codex/concepts/sandboxing#prerequisites. Codex will use the bundled bubblewrap in the meantime.
2026-09-26T12:58:48.984934Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:49.160648Z ERROR rmcp::transport::worker: worker quit with fatal: Transport channel closed, when UnexpectedServerResponse("HTTP 401: {\n  \"error\": {\n    \"message\": \"Provided authentication token is expired. Please try signing in again.\",\n    \"type\": \"invalid_request_error\",\n    \"code\": \"token_expired\",\n    \"param\": null\n  },\n  \"status\": 401,\n  \"detail\": {\n    \"code\": \"token_expired\",\n    \"message\": \"Provided authentication token is expired. Please try signing in again.\"\n  }\n}")
2026-09-26T12:58:49.179136Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:49.179192Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:49.179273Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:49.244718Z ERROR rmcp::transport::worker: worker quit with fatal: Transport channel closed, when UnexpectedServerResponse("HTTP 401: {\n  \"error\": {\n    \"message\": \"Provided authentication token is expired. Please try signing in again.\",\n    \"type\": \"invalid_request_error\",\n    \"code\": \"token_expired\",\n    \"param\": null\n  },\n  \"status\": 401,\n  \"detail\": {\n    \"code\": \"token_expired\",\n    \"message\": \"Provided authentication token is expired. Please try signing in again.\"\n  }\n}")
2026-09-26T12:58:49.812256Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:49.959979Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:50.091814Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:50.204385Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:50.383496Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:50.383554Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:50.383597Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:50.897367Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:50.897472Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:50.897533Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: Reconnecting... 2/5
2026-09-26T12:58:51.607915Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:51.608008Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:51.608071Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: Reconnecting... 3/5
2026-09-26T12:58:52.657503Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:52.657592Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:52.657652Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: Reconnecting... 4/5
2026-09-26T12:58:54.484034Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:54.484120Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:54.484178Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: Reconnecting... 5/5
2026-09-26T12:58:58.138993Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:58.139076Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:58.139132Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
warning: Falling back from WebSockets to HTTPS transport. workspace routing discovery unauthorized (401)
2026-09-26T12:58:58.401386Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:58.401444Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:58.401489Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: Reconnecting... 1/5
2026-09-26T12:58:58.880073Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:58.880174Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:58.880278Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: Reconnecting... 2/5
2026-09-26T12:58:59.613401Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:59.613480Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:58:59.613535Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: Reconnecting... 3/5
2026-09-26T12:59:00.744838Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:59:00.744926Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:59:00.744983Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: Reconnecting... 4/5
2026-09-26T12:59:02.724793Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:59:02.724874Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:59:02.724934Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: Reconnecting... 5/5
2026-09-26T12:59:06.169428Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:59:06.169511Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
2026-09-26T12:59:06.169567Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: workspace routing discovery unauthorized (401)
2026-09-26T12:59:06.543135Z ERROR codex_login::auth::manager: Failed to refresh token: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
ERROR: workspace routing discovery unauthorized (401)

@youknowone
youknowone merged commit b18ddc8 into main Sep 26, 2026
17 of 18 checks passed
@youknowone
youknowone deleted the fix/main-ci branch September 26, 2026 14:03
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