FA-60038 / Inventory cost layering / Member archive
Dollar-value LIFO layering: new layer index · case 03
A newly added layer is valued at base-year prices, understating LIFO inventory.
Case contract
Input {layers:[[year, base_dollars, index_bp]] oldest first, year, ending_current_cost, index (bp, 10000 = base year)}. Ending base dollars = round-half-up(current cost*10000/index). An increase over the prior base total adds one layer at the current index; a decrease strips base dollars from the newest layers first, removing layers that reach zero. LIFO value = sum of round-half-up(base*index/10000) per layer. Return {end_base, layers, lifo_value}.
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 |
|---|---|---|---|
| new layer | {"end_base": 13304, "layers": [[2020, 10000, 10000], [2021, 2000, 10800], [2022, 1304, 10000]], "lifo_value": 13464} | {"end_base": 13304, "layers": [[2020, 10000, 10000], [2021, 2000, 10800], [2022, 1304, 11500]], "lifo_value": 13660} | 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 ↗