validator: detect ambiguous (duplicate) filament subtypes per printer (#14459)

* validator: detect duplicate filament subtype per printer (opt-in)

A filament is matched from the AMS by (filament_id + printer compatibility);
if two compatible filament presets for one printer share a filament_id, the
match is ambiguous and the runtime silently picks whichever loads first.

Add PresetBundle::check_duplicate_filament_subtypes(), gated behind a new
has_errors(check_duplicate_filament_subtypes) parameter and the validator's
-f/--check_filament_subtypes flag (off by default). For each system printer it
groups its vendor's compatible filament presets by filament_id and errors on
any group of 2+, reporting each preset as a clickable file:// URI with a single
"how to fix" hint. CI runs it for BBL only (-v BBL -f) until the other vendors'
profiles are cleaned up.

* profiles: fix ambiguous BBL filament matches

Resolve the duplicate-filament-subtype errors flagged by the validator:
- align compatible_printers with Bambu Studio where Orca over-claimed a nozzle
  that already has a dedicated preset (Bambu PLA Basic/Matte/ABS @BBL H2DP;
  Bambu ASA/PETG HF @BBL H2DP 0.6 nozzle; Fiberon PETG-ESD @BBL X1)
- fix a copy-pasted printer name in Overture Matte PLA @BBL A1M 0.2 nozzle
- fix a wrong inherits in Panchroma PLA Silk @BBL X1C 0.2 nozzle (was inheriting
  Panchroma PLA @base, giving it filament_id GFPM001 instead of GFPM004)

Bump BBL profile version.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
SoftFever
2026-06-28 00:42:02 +08:00
parent 3808f95a26
commit d1369e45c8
13 changed files with 134 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "Bambulab",
"url": "http://www.bambulab.com/Parameters/vendor/BBL.json",
"version": "02.01.00.17",
"version": "02.01.00.18",
"force_update": "0",
"description": "BBL configurations",
"machine_model_list": [

View File

@@ -123,8 +123,7 @@
"0 0 0 0 0 0"
],
"compatible_printers": [
"Bambu Lab H2D Pro 0.4 nozzle",
"Bambu Lab H2D Pro 0.6 nozzle"
"Bambu Lab H2D Pro 0.4 nozzle"
],
"filament_start_gcode": [
"; filament start gcode\n"

View File

@@ -117,8 +117,7 @@
"0 0 0 0 0 0"
],
"compatible_printers": [
"Bambu Lab H2D Pro 0.6 nozzle",
"Bambu Lab H2D Pro 0.8 nozzle"
"Bambu Lab H2D Pro 0.6 nozzle"
],
"filament_start_gcode": [
"; filament start gcode\n"

View File

@@ -132,8 +132,7 @@
"0 0 0 0 0 0"
],
"compatible_printers": [
"Bambu Lab H2D Pro 0.6 nozzle",
"Bambu Lab H2D Pro 0.8 nozzle"
"Bambu Lab H2D Pro 0.6 nozzle"
],
"filament_start_gcode": [
"; filament start gcode\n"

View File

@@ -144,8 +144,7 @@
"0 0 0 0 0 0"
],
"compatible_printers": [
"Bambu Lab H2D Pro 0.4 nozzle",
"Bambu Lab H2D Pro 0.6 nozzle"
"Bambu Lab H2D Pro 0.4 nozzle"
],
"filament_start_gcode": [
"; filament start gcode\n"

View File

@@ -150,8 +150,7 @@
"0 0 0 0 0 0"
],
"compatible_printers": [
"Bambu Lab H2D Pro 0.4 nozzle",
"Bambu Lab H2D Pro 0.6 nozzle"
"Bambu Lab H2D Pro 0.4 nozzle"
],
"filament_start_gcode": [
"; filament start gcode\n"

View File

@@ -9,6 +9,6 @@
"1.8"
],
"compatible_printers": [
"Bambu Lab P1P 0.2 nozzle"
"Bambu Lab A1 mini 0.2 nozzle"
]
}

View File

@@ -7,8 +7,6 @@
"instantiation": "true",
"compatible_printers": [
"Bambu Lab X1 0.4 nozzle",
"Bambu Lab X1 Carbon 0.4 nozzle",
"Bambu Lab P1S 0.4 nozzle",
"Bambu Lab X1E 0.4 nozzle"
],
"overhang_fan_speed": [

View File

@@ -1,7 +1,7 @@
{
"type": "filament",
"name": "Panchroma PLA Silk @BBL X1C 0.2 nozzle",
"inherits": "Panchroma PLA @base",
"inherits": "Panchroma PLA Silk @base",
"from": "system",
"setting_id": "GFSPM004_09",
"instantiation": "true",