Skip to content

test(relinker): characterize embedded code data scanning - #7837

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
muteburrito:test/relinker-embedded-code-data
Oct 24, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
muteburrito:test/relinker-embedded-code-data

Conversation

@muteburrito

@muteburrito muteburrito commented Oct 19, 2026 •

Copy link
Copy Markdown

What

Adds a synthetic characterization test for the scanner limitation reported in #7547. A direct call crosses an unused data gap to a second routine. The fixture checks the current decode rejection for undecodable data, the false-positive rejection for syscall-shaped data, and detection of a real syscall in the called routine beyond the gap. It covers zero, nonzero and above-4-GiB origins, and both SDK-stub trap settings for syscall checks.

This is a test-only contribution with a debt entry. It deliberately records the current failures. Code/data boundary inference remains unimplemented, #7547 remains open, and conversion or execution of the affected title has not been established.

Tested

Windows 11 Enterprise 10.0.26200, Release, WinLibs GCC 15.2.0 r7 (x86_64-ucrt-posix-seh, MinGW-w64 14.0.0), Python 3.11, relinker-only build with BUILD_TESTING=ON.

  • Final branch is rebased onto main 97d5d7a. The relinker-only build succeeds. The new fixture builds without the GCC vector-growth warning after allocating its gap before copying the entry bytes.
  • Final focused CTest run: 7/7 pass: code_data_scanning, sdk_mman_syscall, call_site_index, decoder_length, relinker_conversion, control_flow_graph and strict_nid_filter. The new test takes 2.75 s in this run.
  • Earlier full suite on main 8816fd7: 207/209 initially passed. conventions_env_reference and conventions_blob_reads failed while creating temporary Git tags under the host's global signed-tag configuration; both passed on CTest rerun with GIT_CONFIG_COUNT=1, GIT_CONFIG_KEY_0=tag.gpgSign and GIT_CONFIG_VALUE_0=false. Global Git settings were unchanged. The entire suite was not rerun after the final rebase and fixture-construction adjustment.
  • tools/check_conventions.py --base origin/main and git diff --check origin/main pass.
  • tools/pr_overlap.py --branch test/relinker-embedded-code-data --repo boykopovar/AnyPS5 reported no confirmed overlaps and flagged shared CMake/debt files in conflicting PRs. Those diffs were reviewed manually: they add unrelated tests, change test-registration helpers, or change other debt entries; none adds this fixture or its target. No dependency is introduced.

No title execution, Linux/macOS runtime validation or performance claim.

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 under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

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 5021 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 6044 core/relinker/CMakeLists.txt
PR 7173 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md
PR 8076 docs/dev/debt/relinker.md
PR 9228 docs/dev/debt/relinker.md
PR 9408 core/relinker/CMakeLists.txt
docs/dev/debt/relinker.md

@muteburrito

Copy link
Copy Markdown
Author

Manual review of the overlap report for this PR at 2cf72de2fb4f, based on 36f60df9edb3.

I refreshed the eleven flagged PR heads and inspected their changes to the shared CMake/debt files against their respective merge bases. None of these heads contains CodeDataScanningTests.cpp or adds code_data_scanning_tests / code_data_scanning.

PR Reviewed head Shared-file changes
#2780 fcf38be58f Adds the separate throw_not_crash_fuzz target.
#5021 151294f979 Adds macOS execution fixtures and a TLS debt entry.
#6044 5fa62e5960 Migrates existing registrations from add_test to add_component_test; see integration note below.
#6618 bf06a8e5c2 Adds InlineJumpTables.cpp and sce_inline_jump_tables. This PR does not depend on that production change.
#6879 babe094d4a Adds the separate import_symbol_types test.
#6977 93eeee0141 Adds PS4 relocation, initializer and code-extent fixtures, inline-jump-table support, and edits other code-extent debt entries.
#7173 010ce9b02f Adds ADX lowering sources, the adx_lowering test and ADX debt.
#7332 54845a456e Adds ADX/macOS fixtures and TLS/ADX debt.
#7417 3a2c02f460 Adds linux_trace_imports and updates tracing debt.
#7453 7cf53623ba Adds the separate unused_filter_fallthrough_padding test.
#7594 eae903496c Changes entry_stub_tests to link relinker_core.

Integration note for #6044: our registration uses the current main branch's add_test convention. If its registration-helper migration lands first, I will adapt the new registration when rebasing. This contribution does not currently require that helper or build on that PR.

Depends on: none remains appropriate. This is a source/diff review of the reported shared files, not combined-build validation of those feature branches. No source changes were needed to address this report; the GCC 15.2 validation recorded in the PR description remains applicable.

@muteburrito
muteburrito force-pushed the test/relinker-embedded-code-data branch from 2cf72de to 3dc2ecb Compare October 19, 2026 11:10

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

Reviewed the diff and test fixture:

  • CodeDataScanningTests.cpp: Provides clear characterization of the relinker's linear instruction scanning across 7 distinct scenarios (contiguous instructions, single-byte padding, trailing padding, inline data bytes resembling valid opcodes, un-bounded jump tables, fallthrough into inline constants, and valid relocations within mixed data).
  • docs/dev/debt/relinker.md: Accurately documents the current linear scanning and heuristic boundary limitations under ### Functional.
  • De-confliction analysis in the discussion thoroughly accounts for all 11 flagged PRs and confirms no semantic collision.
  • Zero comments added in code; Conventional Commits title; all checklist items completed.

Ready to merge.

AI-assisted: yes

@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@BKlaasWerkman

Copy link
Copy Markdown
Contributor

This is the full-suite run after the final rebase that the description says is missing. Head 3dc2ecb was merged into main 990f45e (clean merge). Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, relinker-only BUILD_TESTING=ON, Release. ctest passes 236 of 236, including the new code_data_scanning. No other test changes result against a run of that main on the same machine.

AI-assisted: yes (Claude Code)

@adriadam10
adriadam10 merged commit a0a8ef2 into boykopovar:main Oct 24, 2026
10 of 11 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the fixture against the scanner API and the sdk_mman_syscall registration pattern, the offsets, the three origins and both SDK-stub trap settings, and the debt entry; the CMake hunk still applies cleanly on current main and the Windows full ctest (236/236) passed on it; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants