Files
kdm-re/include/gk/core/validity.h
T
ulw-execute 9f96ef8ffc feat(arch): portable-core seam + gk::fp dual-fidelity + i386-gated ABI + seam-symbol check
Introduce the core/platform/host header seam under include/gk/ (portable value
types in core/, Kinect/PE mirror layouts in platform/, the camera-elevation
service interface in host/); the existing include/gk/structs/* paths become
compatibility forwards so no definition is duplicated. Add include/gk/fp.h with
gk::fp::round32 (binary32 rounding barrier) and gk::fp::ExtendedAcc (long double
faithful / double portable), and a GK_FIDELITY=faithful|portable CMake knob
paired with -mfpmath; faithful stays the drop-in differential target. i386-gate
GK_CDECL/STDCALL/THISCALL so non-i386 GNU builds get empty macros (native
-Werror). Migrate the three proven slice functions onto the seam without
behaviour change: box_distance expresses FP through gk/fp.h while keeping the
volatile spill the differential pins; the bodies stay in src/game/*.cpp where
prove_t11.py compiles and greps them. Add tools/seam_symbol_check.py (G5) and
re/game/seam_symbols.json asserting each flagged seam RVA ships as a
non-inlined, addressable symbol.

Verified: prove_t11.py exit 0 / ALL DIFFERENTIALS PASS (faithful, exact-FP from
df1620e); native GK_FIDELITY=portable validity compile under -Werror; macro
cross-check; G5 tool reports all three seam symbols addressable.
2026-11-29 00:54:30 -05:00

30 lines
789 B
C++

#pragma once
// Portable-core value types for the validity gate; layout pinned by
// gk/offsets_assert.h. See docs/conventions.md ("Module ownership").
#include "gk/core/math.h"
namespace gk {
// DAT_103d3230: two corners consumed as six consecutive floats by
// FUN_101ab6d0's clamp-and-distance validity check.
GK_PACK_PUSH(8)
struct ValidityBox {
Vec3 minimum;
Vec3 maximum;
};
// DAT_103e29b0..DAT_103e29cf, repeated with stride 0x20 for six candidates.
// FUN_100e4140 writes source position at +0x00, transformed position at +0x0c,
// tracking id at +0x18, and the validity byte at +0x1c.
struct ValidityCandidate {
Vec3 source_position;
Vec3 transformed_position;
float tracking_id;
std::uint8_t valid;
std::uint8_t reserved[3];
};
GK_PACK_POP
} // namespace gk