f/tests
Greg Pomerantz 9f657dc9f4 Tax engine: apply NIIT + state/local to the equity path (not just recorded taxes)
The full rate stack (federal + NIIT + state) was used for the recorded
tax columns and for realized gains at rebalances, but the equity path
itself deducted only the FEDERAL rate in two places:

1. distribution reinvestment kept (1 - div_rate)/(1 - lt_rate) instead of
   (1 - div_rate - niit - sl_rate);
2. the per-date liquidation tax ('sell everything today') passed bare
   (lt_rate, st_rate) to _liquidation_tax.

Symptom: FLCSX 10Y showed a 1.4pt after-tax drag instead of the true
~2.8pt. Fix: d_keep/c_keep factors and stacked liquidation rates.

Regression tests pin the equity path: reinvested net with NIIT+state,
ST and LT liquidation tax at the full stack (all fail on the old code).

Corrected 2015-2026 NYC after-tax: SPY 13.82->11.23, IVV 13.81->11.22,
JLPSX 13.68->9.18 (previously reported 12.51/12.50/11.31, superseded).
2026-09-01 17:22:04 -04:00
..
test_app.py app: background cache refresh, per-benchmark stats, correlation tab, global date range 2026-08-25 18:15:47 -04:00
test_data.py Fix Yahoo total-distribution double count (1,957 syms) 2026-09-01 16:23:03 -04:00
test_e2e_browser.py Stock & Portfolio Analyzer: full UI rework 2026-08-24 16:05:27 -04:00
test_fundlab.py CEF stage 2b: per-share financial-highlights parser (cef_annual.py) 2026-08-28 07:30:16 -04:00
test_tax.py Tax engine: apply NIIT + state/local to the equity path (not just recorded taxes) 2026-09-01 17:22:04 -04:00