[Draft] Generate platform-specific member layouts in UVTD#1343
Closed
tc-imba wants to merge 2 commits into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Caution
This draft was implemented and reviewed with substantial AI assistance using OpenAI Codex and the superpowers workflow. The commits have passed automated tests and multiple independent AI review gates, but they should still be treated as untrusted until a maintainer or the author completes a human hunk-by-hunk audit.
Why this PR exists
This is the first focused rewrite extracted from the much larger Linux experiment in #1342. It responds directly to the maintainer feedback here:
#1342 (comment)
The key issue was that UEPseudo member-layout files are UVTD-generated output, so Linux support must not hand-edit generic generated wrappers or mutate offsets at runtime. This PR moves the platform-specific source of truth into UVTD and makes UVTD generate complete platform setter files plus compile-time selection.
This PR changes generation only. It does not add Linux runtime support to RE-UE4SS, does not change xmake, and contains no Palworld runtime/product code.
Provenance
b50986bd114f4cb187d9309846b003419c38b73ba9e1c50138a87a17021e9b841c6b9db7b4d30f78d606d8ddebe6852d35f44b5b5ffa7c8de18b79eea9e1c50138a87a17021e9b841c6b9db7b4d30f78What changed
1. Platform member-layout configuration
UVTD now loads
platform_member_layouts.jsonfrom both the development config and the bundled default config. Each entry identifies:The initial data set contains complete Linux UE 5.1 layouts for
FPropertyandUEnum. The model is intentionally platform/version/class based rather than embedding product-specific runtime adjustments.Configuration loading validates identifiers, path tokens, version/class/member names, offsets, duplicate platform/version entries, and duplicate
(version, class, ifdef_macro)selections. Invalid reloads fail closed and retain the previously valid in-memory configuration.2. Deterministic generated setter publication
PlatformMemberLayoutGeneratorplans all output paths before writing, rejects both exact and ASCII case-folded collisions, and emits complete setter fragments under:Publication is transactional:
Platform generation and preflight happen before the existing generic/virtual cleanup, so invalid platform configuration cannot erase the prior output set.
3. Generated compile-time selection
UnrealVirtualGeneratornow emits deterministic platform branches at member-layout include sites, followed by the existing generic include as the fallback. It supports zero, one, or multiple platform definitions and preserves the existing suffix-specific generation behavior.For the current data, UVTD generates Linux selection only for UE 5.1
FPropertyandUEnum. Generic generated wrappers remain platform-neutral.4. Regression coverage
The focused tests cover configuration parsing and transactional reload, invalid tokens and identifiers, duplicate selection macros, deterministic output, exact/case-folded collisions, preservation of prior output on rejection, staging/backup cleanup behavior, and generic/suffix-specific include fallbacks. Root-level CTest discovery is also enabled for these targets.
Generated-output evidence
A fresh generator run from
a9e1c50138a87a17021e9b841c6b9db7b4d30f78produced files byte-identical to the coordinated UEPseudo PR:FProperty:62bc54dccf0c602b4e53ea298fe8ab9e527268d3cf1d4f91a3bba1e05d7d7f5aUEnum:3040d454894336fd3f6477fee7ca4c572a55e6053fe645a9ea0bdc974fbbd1f0Verification performed
Windows-target build using clang-cl/xwin:
export XWIN_DIR=/home/liu/.xwin cmake --build /tmp/re-ue4ss-uvtd-xwin-baseline \ --target UnrealVTableDumper \ PlatformMemberLayoutConfigTests \ PlatformMemberLayoutGeneratorTestsResult: exit 0; all requested targets were up to date after their successful build.
Focused Windows executables under Wine:
Result: 2/2 tests passed.
Generated-output integration:
Result: generator tests passed; the two generated setter hashes matched the values above and were byte-identical to PR B.
With PR B temporarily checked out in
deps/first/Unreal:Result: exit 0;
Game__Dev__Win64/lib/Unreal.liblinked successfully. The submodule was then restored to the upstream-pinned SHA.Additional gates passed:
git diff --check, exact path allowlist, committed/staged/unstaged/untracked no-xmake guard, generated hash comparison, and clean worktree checks.Suggested review and merge plan
Because this is still a substantial generator change, I suggest treating the architecture decision separately from the rest of the Linux port:
mainis premature, merge or retarget this draft to a temporary integration branch such aslinux-platform-layouts.The old reference experiment still contains product-specific and rough exploratory code. I intend to clean/rewrite that later, including removing Palworld-specific content where it does not belong. None of that content is being proposed in this PR.
Known non-blocking review notes
These were classified as non-blocking in the final review, but are useful follow-up hardening work if maintainers accept the architecture.
Architecture question for maintainers
Is a config-driven UVTD source of truth that emits complete platform-specific setter files, with compile-time platform selection and the existing generic setters as fallback, an acceptable architecture for this project?
Review provenance
This PR will remain draft until the human audit is complete and maintainers confirm that the platform-specific generated-layout architecture matches project expectations.