Skip to content

PE loader: rewrite console wait instructions after first fault - #157

Draft
bmjask wants to merge 1 commit into
stack/153-release-pipeline-permitsfrom
stack/154-rewrite-console-waits
Draft

bmjask wants to merge 1 commit into
stack/153-release-pipeline-permitsfrom
stack/154-rewrite-console-waits

Conversation

@bmjask

@bmjask bmjask commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Stacked on #156.

This is an internal draft stack in bmjask/xcl; it is not an upstream merge request.

What and why

This unit isolates pe loader: rewrite console wait instructions after first fault as one reviewable step in the redesign.

Upstream overlap

This is sourced from upstream PR xcl-dev#2618 and is retained only as an internal reconciliation draft.

What is in it

  • 840ecf3c is the cleaned-stack form of integrated commit 790b1403.

The patch content is preserved; only ancestry changed to omit a canceled add/revert sequence.

Tested

Tests were not rerun while packaging this already-integrated change into the draft stack.

Regression run

Not run during stack packaging.

Not tested

  • Windows MSVC build and test suite
  • D3D12 GPU execution
  • scripts/smoke.ps1 main/head comparison

AI use

Codex, GPT-5.6-sol, removed canceled ancestry, created the stack branch, and drafted this description. It did not author new code during stack packaging.

@bmjask
bmjask force-pushed the stack/153-release-pipeline-permits branch from e6fa6f1 to ad4b369 Compare November 27, 2026 00:45
@bmjask
bmjask force-pushed the stack/154-rewrite-console-waits branch from 840ecf3 to 99b5abb Compare November 27, 2026 00:45
@bmjask
bmjask force-pushed the stack/153-release-pipeline-permits branch from ad4b369 to faaaa36 Compare November 27, 2026 01:00
@bmjask
bmjask force-pushed the stack/154-rewrite-console-waits branch 2 times, most recently from 83047b5 to 964c24e Compare November 27, 2026 05:14
Repeated monitorx and mwaitx emulation can raise tens of thousands of illegal-instruction exceptions per second on Intel CPUs. Replace each aligned site atomically with nops or pause plus nops after its first fault.

Serialize page protection changes, retry word replacement after interference, preserve adjacent rewrites, restore RX protection, flush the instruction cache, and recognize exceptions already in flight at a newly rewritten site.

Adapted from PR xcl-dev#2618 by Tarosul and Claude Code (Claude Opus 5.5). That PR measured a retail workload improving from 1.24 to 2-3.5 presents/s. The Windows GNU cross-target check passes; native Windows tests and smoke were unavailable here.

Assisted-by: Codex (GPT-5.6-sol)
@bmjask
bmjask force-pushed the stack/153-release-pipeline-permits branch from 44ab23f to c3fd279 Compare November 27, 2026 12:35
@bmjask
bmjask force-pushed the stack/154-rewrite-console-waits branch from 964c24e to 8b12819 Compare November 27, 2026 12:35
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