Skip to content

fix(bdc): exclude a subtotal that repeats its one holding's cost - #1819

Open
mmitc wants to merge 3 commits into
dgunning:mainfrom
mmitc:fix/1583-subtotal-cost-match
Open

mmitc wants to merge 3 commits into
dgunning:mainfrom
mmitc:fix/1583-subtotal-cost-match

Conversation

@mmitc

@mmitc mmitc commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

What this changes

Before: since #1506, _exclude_restated_rows kept any row with its own cost over a single extending row. PhenixFIN tags each company subtotal with the same fair value and cost as its only holding, so its Q2 2026 10-Q kept 16 subtotals (14 company, 2 category) as holdings (+$289.5M), and New Mountain's FY2025 10-K counted ACI Parent's preferred twice (+$2.1M). After: such a row is excluded when the row under it states the same cost under a longer label. It is still kept when the costs differ (ARCC's Proofpoint, #1505) or when the row under it adds only one word, such as a counter ("... loan" / "... loan 1", "... One"), so every pair #1506 restored stays restored.

Fixes #1583

Part of #1593.

This is the narrower rule from my comment on #1506, plus the counter case: cost alone would drop ARCC's Nordic Ferry and RMS HoldCo pairs again (same fair value and cost, two holdings) and BCSF and TRIN pairs told apart by " One".

Re-parse of 38 BDC 10-K and 10-Q filings, from_xbrl(find(accession).xbrl(), period=<report date>), main at 691b322 against this branch:

Filing Before: rows, kept fair value After: rows, kept fair value Reported total
PFX 10-Q 0001213900-26-085667 84, $1,091,046,941 68, $801,552,171 None
NMFC 10-K 0001496099-26-000008 379, $2,767,564,000 378, $2,765,477,000 $2,742,013,000
The other 36 unchanged, row for row

PFX's 68 rows are 5.61.1's 67 plus the #1504 loan. They still sum above PFX's stated $301.6M because of older defects this PR does not touch, all present in 5.61.1: a kept grand-total row "Investments" ($301.6M), the non-controlled category total ($136.4M) and FlexFIN's doubled equity ($35.3M) noted on #1583, and three company subtotals labelled apart from their holdings ($26.5M).

Verification

  • Ground truth: PhenixFIN 10-Q for 2026-06-30, accession 0001213900-26-085667; row count and fair-value sum read from the filing. New Mountain FY2025 10-K 0001496099-26-000008 for the ACI Parent rows.
  • Regression test in tests/issues/regression/test_issue_1583_subtotal_repeating_its_holding.py, docstring links BDC: since 5.62.0, from_xbrl keeps PhenixFIN's per-company subtotals as holdings (+$289.5M on a $301.6M book) #1583: three offline tests (a PFX-shaped subtotal, ARCC's counter twins, NMFC's non-accrual copy) and one PFX network test. The subtotal, non-accrual and PFX tests fail on main; all four pass with the fix. test_issue_1505.py passes unchanged, including ARCC's 1,447 rows reconciling to $29,349,300,000.
  • Cassette recorded from live SEC on 2026-10-17, not edited: test_phenixfin_subtotals_are_not_holdings.yaml (two requests, 13.6 MB). The NMFC case is offline because its submission records at 91 MB.
  • Changelog: changelog.d/1583.fixed.md (427 characters).

Rebased on main at 691b322 (2026-10-24). pytest -m fast -n 3 on Linux, Python 3.13: 50,262 passed, 1 failed; main gives 50,259 passed and the same 1 failure, test_issue_457_locale_cache_fix.py, which fails in this environment because it runs as root. Network tests in tests/bdc and the BDC regressions (test_3vad_*, test_6xxb_*, test_issue_1324, 1372, 1373, 1504, 1505, 1583, 1587): 287 passed. ruff check on the changed files reports the same 4 findings as main; check_cassettes.py and check_regression_provenance.py pass.

6.0

AI assistance

  • Assisted. Tool: Claude Code.

Working context (optional)

Re-parsed: the 37 BDC filings measured for #1596 (24 filers, 2023 to 2026) plus New Mountain's FY2025 10-K. List on request.

…gunning#1583)

Since dgunning#1506 a costed row over one extending row was always kept, so
PhenixFIN's 10-Q 0001213900-26-085667 kept 16 company subtotals as holdings
(84 rows, $1,091,046,941) and New Mountain's FY2025 10-K 0001496099-26-000008
counted ACI Parent's preferred twice. Such a row is now excluded when the row
under it states the same cost, unless that row adds only a counter (ARCC's
"... loan" / "... loan 1" pairs stay two holdings).

Re-parsing 38 BDC filings: PFX 68 rows, $801,552,171; NMFC -$2,087,000; the
other 36 unchanged row for row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants