mirror of
https://github.com/Heretek-AI/game-engine.git
synced 2026-11-07 22:42:36 -10:00
parity: 65 fix AbiLayoutTests fnptr reflection (IsFunctionPointer)
This commit is contained in:
1 parent
06570d437c
commit
bca8de77b9
2 files changed
+9
-1
No files matched your search
@@ -170,3 +170,11 @@ Chunk_Spike_Mover.g.cs(37,65): error CS1503: Argument 3: cannot convert from 'de
|
||||
## ILLU-FOLLOW-4d: CodeRabbit doc-contract fix (memchr safety claim)
|
||||
- CodeRabbit's first real review of PR #53 (after OSS rate-limit reset; `@coderabbitai review` retried x4 until "Review triggered" then "Review finished") posted 1 Minor thread: `name_copy.hpp` header comment claimed unterminated input "can never drive an over-read", but `memchr(src,0,N-1)` itself reads up to N-1 bytes — a shorter unterminated buffer would over-read. Valid finding, doc-only fix: header + function comments now state the contract (src must be NUL-terminated within its readable range or expose >= N-1 readable bytes; shorter unterminated input needs an explicit length this helper doesn't take). No behavior change; both call sites pass valid C strings.
|
||||
- qa-gate round 1 verdict: code correct, Sonar green, but CI matrix was still in_progress at reviewed HEAD 6adfcf3 and CodeRabbit had never run (rate-limit). Re-review requires CI green at final HEAD + CodeRabbit run with threads resolved.
|
||||
|
||||
## P0-01 fnptr reflection (parity/p0-01-fnptr-reflection, 2026-10-30)
|
||||
- Fix: `managed/Engine.Tests/AbiLayoutTests.cs:96` — `f.FieldType.IsPointer` → `f.FieldType.IsFunctionPointer || f.FieldType.IsPointer` (§4.8). For `delegate* unmanaged[Cdecl]<int, void> F`, `IsPointer` is false on .NET 10 (`dotnet --version` → 10.0.403); only `IsFunctionPointer` is true. Message text unchanged; `NativeApi.g.cs` untouched.
|
||||
- Verified the shipped test binary actually carries the fix: IL member list contains `get_IsFunctionPointer` only after the edit+rebuild (stashed pre-fix build lacks it); `md5sum` of bin DLL was stale-identical across rebuilds due to deterministic build, so used `strings`/IL-grep, not hash, to confirm.
|
||||
- Before (fix stashed): `cmake -S . -B /tmp/oot-prefix-check ... && cmake --build ... && ctest -R "engine_compositor_live$"` → `AbiLayoutTests: 42 FAILED` (all 42 `ApiTable.* is fnptr` lines `[FAIL]`), plus the live-probe `DllNotFoundException` lines.
|
||||
- After: same OOT command → `AbiLayoutTests: all checks passed`; remaining `engine_compositor_live` failure is only the live probe (`CompositorApiTests: 1 FAILED`, `PhysicsApiTests: 1 FAILED`, `DllNotFoundException: Unable to load engine_core`).
|
||||
- Root cause of residual (pre-existing, out of P0-01 scope): `TryPreloadEngineCoreHandle` (CompositorApiTests.cs:208, PhysicsApiTests PhysicsLivePreload) only probes staged CWD/appdir siblings after an upward walk finds `Engine.slnx`; under `/tmp/oot/.../compositor_live` the walk never reaches the repo so it returns `IntPtr.Zero`, and bare-SONAME `NativeLibrary.TryLoad("engine_core")` fails (verified false even with `LD_LIBRARY_PATH` set; absolute-path `NativeLibrary.Load` succeeds and exports `engine_get_api_table`). In-tree preset works because the walk finds the repo and then `build/ci-linux/native`. Gotcha #19 documents the OOT/in-tree difference.
|
||||
- In-tree acceptance (§3.2): `cmake --preset ci-linux && cmake --build --preset ci-linux && SDL_VIDEO_DRIVER=offscreen ENGINE_REQUIRE_GPU=1 ctest --preset ci-linux` → full suite green,incl. `engine_compositor_live` (`AbiLayoutTests: all checks passed`, `[LIVE] compositor live path engaged`, `CompositorApiTests: all checks passed`, `PhysicsApiTests: all checks passed`).
|
||||
@@ -93,7 +93,7 @@ public static class AbiLayoutTests
|
||||
continue;
|
||||
}
|
||||
|
||||
failures += Check(f.FieldType.IsPointer, $"ApiTable.{f.Name} is fnptr");
|
||||
failures += Check(f.FieldType.IsFunctionPointer || f.FieldType.IsPointer, $"ApiTable.{f.Name} is fnptr");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user