Skip to content

Fix order-dependent weight validation in get_blend_from_list#5648

Draft
Anurag461 wants to merge 1 commit into
NVIDIA:mainfrom
Anurag461:fix/blend-weight-parsing-map-consumed
Draft

Fix order-dependent weight validation in get_blend_from_list#5648
Anurag461 wants to merge 1 commit into
NVIDIA:mainfrom
Anurag461:fix/blend-weight-parsing-map-consumed

Conversation

@Anurag461

Copy link
Copy Markdown

get_blend_from_list shared a single-use map() iterator between any(...) and all(...), so the mixed weighted/bare-prefix validation depended on the position of the first unparseable weight: ['30','a','b','c'] was silently accepted (mis-parsed) while ['a','b','70','c'] raised. Fix materializes the check into a list and adds an explanatory assertion message; behavior is now order-independent. Adds tests/unit_tests/data/test_utils.py, whose parametrized mixed-weight case fails on main and passes with this change.

any(...) and all(...) shared a single-use map() iterator, so the mixed
weighted/bare-prefix check depended on the position of the first unparseable
weight (e.g. ['30','a','b','c'] slipped through while ['a','b','70','c'] was
rejected). Materialize the check into a list and add a regression test.

Signed-off-by: Anurag Kashyap <anurag1457@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 4, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants