Skip to content

app, docs: classify census imports as the loader binds - #84

Open
PrivacyOnion wants to merge 1 commit into
MiamiGame:mainfrom
PrivacyOnion:app/census-loader-classes
Open

PrivacyOnion wants to merge 1 commit into
MiamiGame:mainfrom
PrivacyOnion:app/census-loader-classes

Conversation

@PrivacyOnion

Copy link
Copy Markdown
Contributor

What and why

Use the loader census, shared title-DLL filter, and built-in stub table to classify imports. The table shows HLE, host, title DLL, table-stubbed, and missing imports. --missing lists missing and table-stubbed imports separately.

Each folder is an independent title scanned without recursion. An explicit file is one image with no title DLLs available. --strict disables host pass-through.

JSON keeps xtp-census 1 and adds title and stubbed counters to the totals and DLL rows, plus a top-level stubbed array with the same row shape as missing.

Fixes: #76
Depends on: none

Area

App and docs. The diff spans 530 changed lines because it replaces the CLI's classification and report aggregation and adds synthetic image coverage for both report formats and independent title folders.

Tests

  • cargo xtask pr-check passes on my machine with --skip test

  • New or changed behaviour has tests that need no game files, or I explain below why it cannot

  • Ran on a title: no (the census reads the folder's images; nothing runs)

  • cargo test -p xtp --locked: 36 unit tests and the four integration tests pass, the new census tests among them (a title DLL that serves an import, an ordinal the stub table names and a title DLL serves, a table-stubbed ordinal, a missing import, independent folders, the file and folder rules).

  • cargo test -p xtp-loader --lib census: 4 passed.

On the title folder of build 1.0.2.1 (18 images), xtp census --missing gives:

functions hle host title stubbed missing
main 995 155 770 – – 70
this PR 962 138 754 68 2 0

The 68 are the exports of three DLLs the title ships in its folder. The 2 stubbed ones are oleaut32.dll ordinals 4 and 6. The total falls by 33 because main counted a function once per distinct (name, hint) pair, so a function imported with different hints by several images counted more than once (for example api-ms-win-core-file-l1-1-0.dll: 41 on main, 24 distinct names). This PR counts each dll!name once.

Provenance

  • I wrote all of this change myself for XTP, or it only moves code already in XTP.
  • Some of it comes from elsewhere. Each source, its licence and the files concerned are listed here, and every licence is compatible with GPL-3.0-or-later:

Read the issue, contributor docs, and existing XTP CLI, loader, HLE, PE, and test code. No XCL or AnyPS5 source was read.

AI assistance: AI coding tools wrote this change and its tests, mainly OpenAI Codex.

Checklist

  • No game data, keys, console SDK code or headers, and nothing that circumvents DRM (asset policy)
  • No code copied from xcl or AnyPS5 (references only: read them to understand, write your own)
  • I agree to license this contribution under GPL-3.0-or-later
  • Title and every commit follow <area>: <summary>; one topic; under 400 changed lines, or the reason is above
  • Docs updated where behaviour, commands or variables changed (README, docs/)

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

Labels

area/app apps/ area/docs docs/, Markdown size/L 400 to 999 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xtp census: classify imports as the loader binds them

1 participant