aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


docs/research-notes/nano-cost-research/native/README.md (7410B)


Nano cost stat318: native arithmetic and cap boundary

Read-only independent REA step6 audit. No native binary access, new session, new proprietary export, client process, DB change or tracked edit. Original 14.9.1 KKR SHA-256 is a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0. sources.json preserves source/extract hashes and exact original Evidence IDs for three original cost bodies, seven original getter/modifier assembly bodies and fourteen complete maintained C bodies. Original addresses use10000000; maintained C uses36000000. Additional prior reports are identified by hashes.

Concrete results

Default and aggregation. Initializer10072760 loads ESI=100 at10072b27, leaves it unchanged along the retained sequence, and stores it into default stat array+4f8 (=318*4) at10072ebe. This establishes client default100, subject to later authoritative base-stat loading. Eligibility/refund read mode0 effective318, through1006dfb0 ->10075ca0.10075ca0 adds the result of 10074a30 to10075c60.10075c60 reads base mode2 plus generic ability trickle. The ordinary resource-weight loader100ecff0 iterates only stat100..168 and inserts those six-weight resources through100ed060.100ec8e0 returns zero for an absent stat row. Thus the ordinary loaded stat318 has no ability trickle. The percentage-penalty special case in10074a30 also applies only to abilities16..21 or trained skills100..168, excluding318.

The modifier map adds signed contributions at100747b4 and subtracts the same contributions at10074b47. The effective getter adds that signed sum to the base value. Nothing in these selected arithmetic bodies multiplies separate 318 reductions together, floors318, or applies a breed-specific reduction limit. For the ordinary supported state, the result is:

effective318 = base318(default100) + equipment318 + activeNano318

The resource loader boundary is explicit: this does not prove no unrelated custom/text registration can ever insert a weight row outside100..168. No such registration is needed by the ordinary selected game contracts. Exact original getter/modifier assembly evidence includes ev_74652ec491811d2dbb9348174f59fabc0739128af4fc0567877aee64d3b28a0e, ev_c27bbca88da1a49ac67c28b427c73045affc7be7b57c2cf2814043387c7a4714, ev_2c98108acd73789969ea7727ff8f5f7bca6eb7e99423b9db494fb68749b32a07, ev_c3dc476ddb84eedb69e4e81bbbd80a7c5bf28e3aca92e4d8e2e0386d6813ad6f, ev_b2a9656c468675646d49b31ff6317ecdfd16fc3991e0dc6484322a01038bea1c, ev_8fbad422c0792a1be57aad44cb4daaa490d05eaa8c77c68e55c15f94fe2215fc.

**Cost eligibility.**10064839..1006488d does, in this exact order:

  1. Read effective318 in mode0 as a signed int32.
  2. FILD it, then FSTP a float32 local at10064859. 3.10098bd0 reads the nano's raw stat407 in mode2; FILD that signed int32.
  3. Multiply by the stored float32 modifier, then float32 .01 at10170894.
  4. Call imported MSVCRT _ftol, using EAX low32.
  5. Read current nano214 in mode2 and accept when signed current >= cost at1006488b..8d. Equality succeeds. This path compares; it does not debit.

The original .01 bytes are 0ad7233c, value0.009999999776482582. There is no float32 product spill before _ftol; replacing the expression with integer division100 or rounding the result to nearest changes boundary behavior. The modifier float32 conversion precedes multiplication; an unsigned integer product computed before conversion is not the recovered expression.

Cost100646a0, refund10066b20 and raw-cost getter10098bd0 share retained Evidence ev_b222a29a2449ed800e75228fac8a9ad597f8c73dce740b461b7fae780389796b. Maintained instruction transcripts confirm signed FILD, explicit float32 modifier stores and signed comparison. Original _ftol import/thunk identity was previously verified; the actual Microsoft runtime payload was not shipped or executed. The maintained runtime conversion truncates toward zero.

No minimum or reduction cap appears in this client chain. A positive authored cost can truncate to zero, and negative effective318 can produce a negative signed computed cost. Both the getter and the eligibility expression preserve these values. No max(1,cost), max(0,318), minimum318=45/50/55, breed lookup or positive percentage cap is present in these complete selected paths. The bounded conclusion is that this 14.9.1 native eligibility/refund chain does not enforce the commonly discussed later breed cost caps. It does not establish that the original server had no separate cap or validation.

Under the selected53-bit/binary64 expression model, small examples are:

Raw407 Effective318 Truncated cost
10 100 9
10 90 8
10 20 1
10 10 0
10 0 0
10 -10 0
10 -20 -1
100 50 49
100 45 44
100 55 54
100 110 109

arithmetic-examples.json records products and the reproducible host model. These are calculations of inspected instructions, not execution of the original DLL. Clientr startup405800 explicitly selects precision53 through _controlfp(0x10000,0x30000); later original gameplay-thread/driver precision remains unobserved. The selected maintained runtime uses double registers. At precision24, intermediate multiplication may round a boundary differently. The existing runtime/precision uncertainty should remain documented rather than silently importing a newer game's integer or cap formula. Arbitrary int32 overflow and _ftol out-of-range behavior are outside supported values.

Refund is recalculated, not a recovered reservation token. Action117 dispatches10066b20 only when its supplied interrupter resolves as SimpleChar and its nano resource exists.10066b72..10066baa recomputes the same cost using the current effective318 and raw407. It adds that amount to current214 at 10066bcf and invokes the ordinary214 setter at10066bdd. There is no saved admission cost read in this helper, and no max-nano clamp here. The ordinary 214 setter1006e030 floors a negative resulting214 at0; it does not generally cap it to maximum221. Therefore a buff expiring during a cast can change this native action117 refund calculation. Server reservations/refunds are a separate authoritative reconstruction policy; do not infer exact original debit/refund timing from the client helper or send117 plus a duplicate resource correction.

Implementation consequences and unresolved questions

Use signed additive318 and the explicit float32 modifier/constant operation order for the selected client-facing cost calculation. No native evidence here supports introducing modern breed caps or a minimum one-point cost. If the server floors final debit at0 to preserve its nonnegative resource domain, label that as server policy: the inspected native expression itself has no such floor. A negative318 must not accidentally become a huge uint32 cost through an early cast. Preserve an admitted reservation once chosen; this audit does not require reproducing the potentially changed117 calculation for an authoritative refund that is already published through resource stats.

Original-server-only caps, original charge distribution/timing, negative-cost validation, and original reservation/refund policy remain unresolved. The available client is sufficient to establish its eligibility arithmetic and absence of a cap in that chain, not the behavior of unavailable server code. No online claims from later AO versions were used.