Environment UV / constant-factor near-plane clipping
17 October 2026 - VERIFIED within the bounded scope below.
Overall completion: 10% estimated weighted project milestones, not code coverage.
Goal active. Continue Sol High with alternate helpers 8c614796 / 8c616844.

Recovered source
  8c61295a..8c612e64: 611 original instruction rows
  source/sa_main_dispatch_environment_constant_near_clip.c
  source/sa_main_dispatch_environment_constant_near_clip_connected.c
The complete helper is byte-checked annotated static C, retaining instruction
order, register effects and delay slots without runtime opcode decoding. Names
are descriptive inferences. Prior sources, reports, DLLs and disc files remain.

Observed behavior
R4/R5/R6 identify three cached vertices. The helper generates UVs from their normals
and the matrix published through 8c890238. It computes 128 + 128 * dot(normal,
matrix column), truncates to integer and stores/re-reads the signed low 16 bits.
It reconstructs camera coordinates where required, rejects orientation where
requested and clips against the near plane. Intersections interpolate the integer
UVs and quantize again before final 1/256 scaling.

Initial UV words occupy stack-local +14 hex. In ordinary single precision, the
frame contains six saved GPRs, one four-byte FR12 save and 50 hex local bytes.
Geometry scratch is 8c890278; output UV scratch is 8c890268; orientation state is
8c8902fc. The input vertex cache remains unchanged. No game calls or lighting
normalizer occur inside this helper.

Packets contain control, projected x/y/reciprocal depth, U/V, factor 1.0 and an
untouched final word. Every emitted vertex gets factor 1.0, including the first
two. This constant is set internally, rather than supplied through FR4 as in the
earlier face-lighting clipper. Quadrilaterals emit in strip order 0,1,3,2; the final
packet carries control f0000000.

Build and tests actually passed
- Strict Clang build: -O2 -Wall -Wextra -Werror; separate connected DLL.
- 764 original-code comparisons: 448 direct helper, 114 clipped parents, two
  alternate-topology plain parents, four draws, four callbacks and 192 meshes.
- All 611 instruction rows, 14 conditional outcomes and all four parent call sites
  covered: 8c61fa0e, 8c61fcca, 8c61fce4 and 8c61ff1c.
- Full 16 MiB RAM, GPRs/SR/PR, both FPU banks/FPSCR, FPUL/MACL, ordered boundaries
  and queue contents/events agree with original execution, including partial state.
- 668 cases complete, 76 match numeric/precision guards (-1), eight match the
  unsupported saved-pointer boundary (-3), 12 match enabled floating-point traps
  (1). Guarded cases compare partial state rather than completed draws.
- 2,206 ordered boundaries, 64,790 numerical operations, 2,254 queue transfers,
  22,686 queue events and 746 new helper invocations checked.
- 522 independent cases include all 192 fully native connected meshes. Checks
  cover initial generated UV words in the original stack layout, signed 16-bit
  wrap, re-quantized intersections, clipped geometry, exact factor 1.0 on every
  vertex, padding, preserved input caches, orientation, counters and cursors.
- Inputs include small fractional, large positive/negative and zero matrix
  coefficients; six crossing masks; varied near planes/projections; accepted/
  rejected/degenerate triangles; both FPU banks and queue halves. Incoming FR4
  words include signed zeros, NaN payloads and negatives; output factors stay 1.0.
  Independent UV math excludes unsupported precision modes and non-default
  rounding; those retain original-instruction comparisons.
- All 192 meshes use native material setup, projection/classification, primary/
  secondary extended headers, environment-constant parent, new clipper and
  finalizer, with zero external game services. Both material layouts 2600000 /
  3600000 hex, windings, banks and cursor halves are covered.
- All 114 focused clipped-parent cases complete without special live-register
  seeding. The four remaining external boundaries are alternate-helper fixtures.
- 120 lifetime regressions / 984 stages passed: 23,264 boundaries, 104,016 numerical
  operations, 10,600 queue transfers, 117,808 queue events and zero external game
  services. Unchanged original models do not reach this new helper. Existing
  native flat paths and independent particle/pool/heap checks are regression proof.
- Final integrity checks passed: generated C/manifest are byte-identical, three
  reports match pinned inputs, repeat registration adds zero duplicates, four
  Python and two PowerShell scripts parse. Dispatcher mapping verifies 658
  pointer loads, 80 spans and 83 selectors. Audits find zero evidence errors and
  zero reports needing source-hash refresh. The app goal remains active.

Limits and next work
Wide FMOV can overwrite the original stack's saved vertex-pointer array. Guard
8c612b32 returns host -3 before an unsupported flags read. The original partial
state matches at this boundary; physical hardware exception dispatch is unmodeled.
All-near direct inputs have original-instruction comparison evidence only, outside
the normal caller contract. Earlier face-family live-register caller preconditions
remain unresolved; this separate unlit family does not change them.
Constructed streams, coherent RAM, MMU-off queues and inherited numerical guards
bound results. GPU FIFO/pixels, MMU-on behavior, physical cache timing, complete
frame driving, full gameplay and playable ports remain unverified. Lifetime pass
order is host-selected. The whole historical workflow was not rerun; the new
linked build and focused/lifetime suites were run.

Registry: 1,093 entries / 1,090 unique module-address pairs, with 1,041 matches
among 10,875 indexed candidates. Another 211 non-texture binaries lack function
indexes. These discovery counts do not measure whole-game code coverage.
Next: 8c614796 (254 rows) / 8c616844 (416 rows), already exported and byte-checked
as analysis in analysis/main_dispatch_environment_constant_lower_inventory.json.
Their 670 rows are not recovered C yet. They are the two remaining explicit
primitive fixtures in this tested mesh chain.
Full decompilation, playable PC/Android/stereo 3DS ports, 60/120/240 FPS, 8K,
SUPIR/settings and later N64/PS1 work remain unfinished. Texture Off must disable
sampling and use vertex colours/material fallback, including when HD is enabled.

Evidence and simple check
Open this guide and SOURCE_HANDOFF.txt. Focused report
analysis/main_dispatch_environment_constant_near_clip_verification.json has
cases_passed=764, rows_covered=611, conditional_edges_covered=14 and
independent_mesh_cases=192. Linked lifetime report
analysis/main_dispatch_environment_constant_near_clip_lifecycle_verification.json
has lifecycles_passed=120 and stage_comparisons=984. No playable game exists yet.
Scripts: recover_main_dispatch_environment_constant_near_clip.py,
build_main_dispatch_environment_constant_near_clip.ps1,
verify_main_dispatch_environment_constant_near_clip.py,
verify_main_dispatch_environment_constant_near_clip_lifecycle.py,
register_main_dispatch_environment_constant_near_clip.py.
Recommended next model: Sol High; alternate helpers still need instruction-level
reverse engineering. No model switch or pause advised.
