Repository navigation
AI: someChatMessageSelection back to 100% - #479
Open
kotijekriv wants to merge 1 commit into
Open
kotijekriv wants to merge 1 commit into
kotijekriv wants to merge 1 commit into
Conversation
… return AICState::someChatMessageSelection (0x004D10B0) read 99.2% (95.8% normalised) in a full build of main: the original pushes edi in front of the player loop's set-up (0x004D1107), ours behind it. Written as an early return that clears aiTauntResponseTimeWindow itself, the first test (in the in-game menu, in a single-player skirmish) moves the push to the original's place: the clear is written in both exits instead of once at the end. The rest is gynt's code from sourcehold#261, one indentation level out, with the checker's style rules applied: the menu test by truthiness, prefix steps, `%=`, a loop for the eight receiver flags, both loops bounded by `countof`, the locals declared where they are first set, the loop comment cut to one line, and the unused `using` lines and the BOOLEnum include dropped. These compile to the same listing. The status line drops "one reordered push edi". Measured on main 0e4a83b with both resolver sets on: 100.0% raw and normalised in a narrow build of this text and in a full build of it. A plain 1..8 player loop reads 61.0% (40.9% normalised) in a narrow build. Not run in game. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Style guide reading (advisory, posted once) 1 possible deviation(s) from REIMPLEMENTATION_STYLE_GUIDE.md across 1 of the 1 reimplemented The match comes first. Where the ugly form is what matched, it stays -- that is the guide's own overriding rule, and rule 21 asks for a one-line comment saying what was measured so the next reader does not retry it. This report is posted once, when the PR opens, and is not repeated on later pushes.
WhereRule 8 — Let the compiler unroll
|
This branch has not been deployed
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.
One function on main that its status has at 100% ("one reordered push edi") and that a full build with both resolver sets on reads at 99.2% (95.8% normalised). It is gynt's code from #261, and the commit credits him as co-author. No header changes.
AICState::someChatMessageSelectionWhat changed
aiTauntResponseTimeWindowitself. The original pushes edi in front of the player loop's set-up (0x004D1107); ours pushed it behind. With the clear written in both exits instead of once at the end, the push lands where the original has it. No other shape tried moved the push, and some made the listing worse: the declarations in four other orders,candidateCountdeclared or zeroed elsewhere, the loop counters in other forms, the player test split or written withcontinue, the clear at the other exits. The rest of the body is one indentation level out.%=, a loop for the eight receiver flags, the player and receiver loops bounded bycountof, the locals declared where they are first set (candidatestoo), and the loop comment cut to one line. The four unusedusinglines and theBOOLEnum.hppinclude are gone.Measured
Stronghold Crusader.exe(3bb0a8c1…5387ac5a), and sourcehold's reccmp with--resolve-wrapped-calls --ignore-security-cookie. The struct resolvers and the function resolvers are enabled locally (not committed)./GLlist (this file is not on it), and with 0x004314E0 (theMapEditorLandscaping_GeneralButtonshandler) left out and its resolver off, as in main's baseline: 0 failed of 2,425 compile steps, 99.58 over 2,441 functions.someChatMessageSelectionreads 100.0 raw and normalised there, with no diff entry (99.2 / 95.8 in the same build of main), and its calleequeueCommandreads what it reads on main (99.1 / 95.2; Four functions on main back to 100%: two signed tick compares, a selection slot and a load order #478 brings it to 100%). Two main functions read lower, and it is how reccmp prints a constant, not their code:Menu::handleMenuItems(0x004F6280) reads 97.9 (91.4 normalised) andMenu::Constructor_Menu(0x004F4100) 98.4 (95.2), both 100.0 before; both compare a menu item's type with the constant 0x11000000, five compares in all, and in this build's layout a symbol of our DLL lies at exactly that address, so reccmp prints the constant as that symbol's name on our side, and the instructions are the same on both sides (UI: the single-player game launch at 100% #466 describes the same two readings). Every other function reads exactly what it read before; against main's own build (made at f489b72, 2,439 functions) the only other changes are main's since then (One more UI::MenuModals function at 100%: ProgressBarBox #467'sMenuModalRenderFunction_ProgressBarBoxand its constructor, UI: the single-player game launch at 100% #466'sLaunchSinglePlayerGameUnk) (unrounded 99.5776 raw and 99.5490 normalised, 2,324 functions at 100.0 raw; with those two at 100.0, 99.5791 and 99.5545, 2,326; main 0e4a83b alone: 99.5788 and 99.5528 over 2,441, 2,325 at 100.0).Checks
Our local style checker gives 0 ERROR and 2 CHECK: SG 8 (the player loop steps by 4), which main's style-lint bot will post once, and its notice. The one-line comment on the loop gives the reason. A plain 1..8 loop reads 61.0% here (40.9% normalised, in a narrow build): MSVC unrolls all eight and folds every index into an absolute address, where the original keeps the index in a register. gynt's comment on main had measured the same (0.92 to 0.67) on the function's earlier shape.
🤖 Generated with Claude Code