Skip to content

Fix SAX parser read of leaf_weights - #723

Merged
chyunsu3 merged 1 commit into
dmlc:mainlinefrom
chyunsu3:fix_xgb_sax_parser
Nov 10, 2026
Merged

chyunsu3 merged 1 commit into
dmlc:mainlinefrom
chyunsu3:fix_xgb_sax_parser

Conversation

@chyunsu3

@chyunsu3 chyunsu3 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

From https://github.com/dmlc/treelite/actions/runs/42772664827/job/129683852743:

Fatal Python error: Aborted
Current thread 0x00007888a5847780 (most recent call first):
File "/home/runner/work/treelite/treelite/python/treelite/frontend.py", line 303 in from_xgboost_ubjson
File "/home/runner/work/treelite/treelite/python/treelite/frontend.py", line 205 in from_xgboost
File "/home/runner/work/treelite/treelite/tests/python/test_xgboost_integration.py", line 489 in test_xgb_multi_target_binary_classifier

Fix: When specifying a sub-range of leaf_weights, use leaf_weights.begin() + X instead of &leaf_weights[X].

The expression &leaf_weights[X] is technically undefined when X == leaf_weights.size(), even though we're only using this to indicate the end of the sub-range. The coverage test builds Treelite in the debug build, where the expression triggers an assertion error.

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.16%. Comparing base (03011f2) to head (fff5c02).
⚠️ Report is 1 commits behind head on mainline.

Additional details and impacted files
@@             Coverage Diff              @@
##           mainline     #723      +/-   ##
============================================
+ Coverage     83.48%   84.16%   +0.67%     
============================================
  Files            75       75              
  Lines          6855     6926      +71     
  Branches        560      560              
============================================
+ Hits           5723     5829     +106     
+ Misses         1132     1097      -35     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chyunsu3
chyunsu3 merged commit 4740ad7 into dmlc:mainline Nov 10, 2026
20 checks passed
@chyunsu3

Copy link
Copy Markdown
Collaborator Author

Admin-merging this to unblock the CI.

@chyunsu3
chyunsu3 deleted the fix_xgb_sax_parser branch November 10, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant