cpu: bind synchronous stack outputs through ordinary imports #888

Merged
R0Y00 merged 3 commits from upstream-pr/895 into main 2026-11-23 16:59:24 +00:00
R0Y00 commented 2026-11-23 16:18:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T16:18:44Z.


Refs #870 and #317. Built on the fixed-frame proof in #889.

Allow an ordinary import binding to declare a synchronous stack output using --stack-output ARG WIDTH. Verify the frame-relative LEA, bound and align the output range, and mark only the declared bytes initialized after the call. The provider must fully write that range, without reading its initial contents or retaining the address. Bindings can declare up to four register arguments and up to eight defined return bytes.

The source-built fixture compares RBP- and RSP-relative output slots, with providers returning a 32-bit status and void. Six controls verify the refusal boundaries.

Windows x64, MSVC 19.51, Release:

ctest --preset release --no-tests=error -R '^cpu_aot_(stack_output|stack_frames|direct_calls|call_entries|import_calls)$' --output-on-failure

5/5 passed. Documentation links, bidi controls and git diff --check passed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6563673416 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/895). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T16:18:44Z. --- Refs #870 and #317. Built on the fixed-frame proof in #889. Allow an ordinary import binding to declare a synchronous stack output using `--stack-output ARG WIDTH`. Verify the frame-relative LEA, bound and align the output range, and mark only the declared bytes initialized after the call. The provider must fully write that range, without reading its initial contents or retaining the address. Bindings can declare up to four register arguments and up to eight defined return bytes. The source-built fixture compares RBP- and RSP-relative output slots, with providers returning a 32-bit status and void. Six controls verify the refusal boundaries. Windows x64, MSVC 19.51, Release: ```powershell ctest --preset release --no-tests=error -R '^cpu_aot_(stack_output|stack_frames|direct_calls|call_entries|import_calls)$' --output-on-failure ``` 5/5 passed. Documentation links, bidi controls and `git diff --check` passed.
upstream-sync closed this pull request 2026-11-24 06:45:17 +00:00
R0Y00 commented 2026-11-24 06:49:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T16:44:31Z.


The first Windows runs after retargeting to main stopped while generating blast_lifted.cpp. The archive adapter still called CodecFrame without the new control-flow edges. Commit 431db89 passes the already computed edges through. On Windows x64, Debug and Release each passed all six checks: cpu_native_archive_blast plus cpu_aot_stack_output, stack_frames, direct_calls, call_entries and import_calls. Fresh CI is running for the pushed candidate.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7107600060 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/895#issuecomment-7107600060). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T16:44:31Z. --- The first Windows runs after retargeting to main stopped while generating blast_lifted.cpp. The archive adapter still called CodecFrame without the new control-flow edges. Commit 431db89 passes the already computed edges through. On Windows x64, Debug and Release each passed all six checks: cpu_native_archive_blast plus cpu_aot_stack_output, stack_frames, direct_calls, call_entries and import_calls. Fresh CI is running for the pushed candidate.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!888
No description provided.