Fix the lbshadow bezier constant and lay out its .sdata2 pool - #2971
Draft
MarkMcCaskey wants to merge 3 commits into
Draft
Fix the lbshadow bezier constant and lay out its .sdata2 pool#2971MarkMcCaskey wants to merge 3 commits into
MarkMcCaskey wants to merge 3 commits into
Conversation
The cubic bezier tangent wrote bez1 as (-4.0f * t) + 1.0f, but retail's .sdata2 holds +4.0f and contains no -4.0f at all, and the target emits fnmsubs where the negated form emits fmadds. Writing it as 1.0f - (4.0f * t) restores both, and drops the pool from eight constants to retail's seven. MWCC orders the literal pool by first appearance in the source, so the recovered constant alone reshuffles it. Add the usual sdata2_order anchor - as itzako, grrcruise and friends already do - to pin the pool to retail's order. .sdata2 goes from 86.79% to 94.34%; the remainder is a second 0.0f and 1.0f that retail holds separately, which one translation unit cannot reproduce. lbShadow_8000E9F0 keeps one two-instruction scheduling transposition (fnmsubs against the t2 multiply); every other function and .data are byte-identical to before.
Report for GALE01 (1b5c160 - 84ea803)📈 Matched data: 87.19% (+0.01%, +112 bytes) ✅ 2 new matches
📈 1 improvement in an unmatched item
📉 1 regression in an unmatched item
|
The spline tangent evaluator at 8000E9F0 shares no .sdata2 constants with the rest of lbshadow, while every later function draws from one shared pool: lbShadow_8000F38C reuses 0.001f and 1.2f from earlier functions, and 0.0f/1.0f each appear twice, once on either side of the boundary. One translation unit cannot emit those duplicates, so the original build compiled the evaluator separately. With the split, lbshadow's pool lays out in natural first-appearance order and drops the sdata2_order anchor entirely; lb_E9F0 keeps a private eight-constant anchor. Both .sdata2 sections are byte-identical to retail, lbshadow's other five functions are exact, and its .data/.sdata contents are unchanged. ground, grmutecity, and grbigblueroute compile byte-identically with the moved declaration. lbShadow_8000E9F0 keeps its two-instruction scheduling transposition and lbShadow_8000F38C still differs by one recycled zero init.
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.
I'm going to keep grinding on this and see if I can get matches here.
From Claude: