FA-60229 / Inventory cost layering / Member archive
LIFO reserve roll-forward: FIFO COGS conversion sign · case 04
Converting to FIFO basis makes COGS higher when the reserve grew.
Case contract
Input {begin:[fifo,lifo], years:[[fifo_end,lifo_end]], lifo_cogs:[per year], tax_bp}. Reserve = FIFO - LIFO. Each year: change = reserve_end - prior year reserve; FIFO-basis COGS = LIFO COGS - change; a year is flagged "decline" when change < 0; cumulative tax deferral = round-half-up(reserve_end*tax_bp/10000). Return list of {reserve, change, fifo_cogs, flag, deferral}.
Why this case matters
Inventory valuation and cost-of-goods decisions depend on this rule.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| rising reserve | [{"change": 496, "deferral": 272, "fifo_cogs": 20496, "flag": "build", "reserve": 1296}, {"change": 304, "deferral": 336, "fifo_cogs": 21304, "flag": "build", "reserve": 1600}] | [{"change": 496, "deferral": 272, "fifo_cogs": 19504, "flag": "build", "reserve": 1296}, {"change": 304, "deferral": 336, "fifo_cogs": 20696, "flag": "build", "reserve": 1600}] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗