Reproduction files (9)
# Repro for issue #18175 — user presets inheriting a sibling in the same folder are silently dropped
Status: **reproduced** on current main (`f939e2b1e`) with the prebuilt Release binary at `$ORCA_BIN`.
Everything below was run on Linux, headless (Xvfb via the MCP harness), 2026-12-06.
## The bug in one sentence
A user preset JSON whose `"inherits"` names another *user* preset stored in the **same
directory** is never installed: loading logs `can not find parent …` at error level, skips the
preset, leaves the file on disk, and shows nothing in the UI — so the preset is simply missing
from the dropdowns.
## Setup
Two files per type in a fresh datadir's user preset folders (seeded by `orca-mcp launch`,
printer `MyKlipper 0.4 nozzle`):
- `user/default/process/ReproParent.json` — `inherits: "0.20mm Standard @MyKlipper"` (a *system* preset)
- `user/default/process/ReproChild.json` — `inherits: "ReproParent"` (a *sibling user* preset)
- `user/default/filament/ReproFilParent.json` — `inherits: "Generic PLA @System"`
- `user/default/filament/ReproFilChild.json` — `inherits: "ReproFilParent"`
The files are in `presets/` (`*.inherits_sibling.json` = the drop-triggering pair,
`ReproChild.standalone.json` = child with `inherits: ""`).
## Steps (automated in `run_repro.sh`)
```bash
./repro/run_repro.sh
# or manually:
orca-mcp launch --bin $ORCA_BIN --datadir $PWD/repro/run2
orca-mcp call preset_list '{"type":"process"}' # and filament
orca-mcp stop
```
## What happened (run of 17:55, log excerpt in `log_run2_dropped.txt`)
- Debug log per directory: parent commits, then
`[error] can not find parent ReproParent for config .../user/default/process/ReproChild.json!`
and `load_presets: loaded 1 presets from ".../user/default/process", type process` (2 JSON files are there).
Same for the filament pair (`ReproFilChild`).
- `preset_list` for process and filament contains `ReproParent` / `ReproFilParent` only —
`ReproChild` and `ReproFilChild` are absent from the app (and hence from the dropdowns).
- Both child files are still on disk afterwards (not removed, no UI warning) — exactly the
reporter's "missing from slicer, still in file explorer".
## Control experiments (same datadir, later runs; excerpt in `log_run2_order_probe.txt`)
1. **Standalone child appears**: rewriting only `ReproChild.json` to `inherits: ""` and relaunching
makes `ReproChild` show in `preset_list` — the file itself was fine; the sibling `inherits`
alone caused the drop. (Mirrors the reporter's "appeared after being made standalone".)
2. **Order inside the same pass is irrelevant**: `AAAChild.json` (sorts *before* `ReproParent.json`,
inherits it) was still dropped — because the whole directory is resolved before any of it is
committed, alphabetical order buys nothing.
3. **Parent in `base/` works**: `ZebraChild.json` in the directory, inheriting `BaseParent` placed in
`user/default/process/base/`, loaded fine — `base/` is loaded in an earlier, separate pass.
So only sibling-in-same-directory inheritance breaks, which is what a topological sort
*within the pass* (or multi-pass fixpoint) would fix.
## Screenshots
`shot_run2_main.png` is all black: only Xvfb with software GL is available here (no KWin /
GNOME), so window capture renders nothing. Not bug-related; the log + `preset_list` output above
is the proof.
## Cause (confirmed by reading current main)
- `PresetCollection::load_presets` (`src/libslic3r/Preset.cpp:2169`) resolves every user preset
file of a directory with `resolve_then_commit<CNumericLocalesSetter>`
(`src/libslic3r/ParallelResolve.hpp`): all `resolve_user_preset` calls of a batch (up to 64
files) run **in parallel before any commit**, and the batch commits into the local
`presets_loaded` deque, which is only merged into `m_presets` after the whole directory
(`Preset.cpp:~2207` `m_presets.insert(...)`).
- `resolve_user_preset` looks the parent up with `find_preset2` (`Preset.cpp:1995`), which searches
only `m_presets` — so a sibling of the same pass is invisible.
- When the `inherits` value is non-empty and not found, `resolve_user_preset` pushes
`"can not find parent %1% for config %2%!"` and returns with `install=false`
(`Preset.cpp:2017-2020`; `out.install = true` is only reached at the end, line ~2057).
- `commit_user_preset` logs the errors and returns at `if (!loaded.install) return;`
(`Preset.cpp:2076-2077`) — file kept, preset dropped, no user-visible error.
- This contradicts the documented contract in `src/libslic3r/Preset.hpp:1014-1016` ("resolves
against the presets loaded before this pass, never another file of the same pass"): sibling
inheritance was supported behavior before the parallel-load optimization
(`f5679ad34 perf: load presets in parallel … (#15943)` — the regression the reporter dates to ~2.5.0),
and `load_presets` performs no topological ordering of `files`.
Secondary reporter symptom ("150 inherits 200, 200 lists only stock U1") is the same mechanism
chained: a hidden intermediate parent hides its children too.
## Files
- `run_repro.sh` — one-shot reproduction script (rebuilds `run2/` datadir).
- `presets/ReproParent.json`, `presets/ReproChild.inherits_sibling.json`,
`presets/ReproFilParent.json`, `presets/ReproFilChild.inherits_sibling.json`,
`presets/ReproChild.standalone.json` — the profile pairs.
- `log_run2_dropped.txt` — drop log from the clean run.
- `log_run2_order_probe.txt` — base/ works, same-dir AAAChild dropped.
- `run2/` — datadir left as after the last scripted run.
#!/usr/bin/env bash
# Reproduce issue #18175: user presets inheriting from a sibling file in the same
# user preset directory are silently dropped at load (current main, built binary).
#
# Uses the MCP harness on a private Xvfb display (orca-mcp wrapper for this slot).
# Screenshots are black under software GL, so the proof is in the debug log and the
# preset_list tool output, both echoed below.
set -eu
HERE="$(cd "$(dirname "$0")" && pwd)"
D="$HERE/run2"
rm -rf "$D"
mkdir -p "$D/user/default/process" "$D/user/default/filament"
cp "$HERE/presets/ReproParent.json" "$D/user/default/process/"
cp "$HERE/presets/ReproChild.inherits_sibling.json" "$D/user/default/process/ReproChild.json"
cp "$HERE/presets/ReproFilParent.json" "$D/user/default/filament/"
cp "$HERE/presets/ReproFilChild.inherits_sibling.json" "$D/user/default/filament/ReproFilChild.json"
orca-mcp stop >/dev/null 2>&1 || true
orca-mcp launch --bin "$ORCA_BIN" --datadir "$D" --timeout 180 >/dev/null
echo "== preset_list (what the dropdowns can offer):"
for t in process filament; do
orca-mcp call preset_list "{\"type\":\"$t\"}" \
| python3 -c "import json,sys; [print(' ',it['name']) for it in json.load(sys.stdin)['items'] if 'Repro' in it.get('name','')]"
done
echo "== files still on disk:"
ls "$D/user/default/process" "$D/user/default/filament"
echo "== debug log:"
LOG=$(ls -t "$D"/log/debug_*.log.0 | head -1)
grep -E "can not find parent|loaded [0-9]+ presets from .*$D/user" "$LOG"
orca-mcp stop
[info] 2026-12-06 17:55:38.233949[Thread 0x00007f13959178c0]:commit_user_preset load preset: ReproParent and filament_id: and base_id:
[info] 2026-12-06 17:55:38.233982[Thread 0x00007f13959178c0]:commit_user_preset2107 load config successful and preset name is:ReproParent
[error] 2026-12-06 17:55:38.234044[Thread 0x00007f13959178c0]:can not find parent ReproParent for config /workspace/work/wt/18175/repro/run2/user/default/process/ReproChild.json!
[info] 2026-12-06 17:55:38.234065[Thread 0x00007f13959178c0]:load_presets: loaded 1 presets from "/workspace/work/wt/18175/repro/run2/user/default/process", type process
[info] 2026-12-06 17:55:38.234641[Thread 0x00007f13959178c0]:commit_user_preset load preset: ReproFilParent and filament_id: OFDSrzZ8 and base_id:
[info] 2026-12-06 17:55:38.234659[Thread 0x00007f13959178c0]:commit_user_preset2107 load config successful and preset name is:ReproFilParent
[error] 2026-12-06 17:55:38.234714[Thread 0x00007f13959178c0]:can not find parent ReproFilParent for config /workspace/work/wt/18175/repro/run2/user/default/filament/ReproFilChild.json!
[info] 2026-12-06 17:55:38.235123[Thread 0x00007f13959178c0]:load_presets: loaded 1 presets from "/workspace/work/wt/18175/repro/run2/user/default/filament", type filament
[info] 2026-12-06 17:55:38.235199[Thread 0x00007f13959178c0]:load_presets: loaded 0 presets from "/workspace/work/wt/18175/repro/run2/user/default/machine", type machine
[info] 2026-12-06 17:57:05.521162[Thread 0x00007f9f91fa78c0]:commit_user_preset load preset: BaseParent and filament_id: and base_id:
[info] 2026-12-06 17:57:05.521175[Thread 0x00007f9f91fa78c0]:set_printer_hold_alias preset name : BaseParent remove action: false insert success: true remove success: false alias: BaseParent
[info] 2026-12-06 17:57:05.521181[Thread 0x00007f9f91fa78c0]:set_printer_hold_alias preset name : BaseParent remove action: false insert success: true remove success: false alias: BaseParent
[info] 2026-12-06 17:57:05.521185[Thread 0x00007f9f91fa78c0]:set_printer_hold_alias preset name : BaseParent remove action: false insert success: true remove success: false alias: BaseParent
[info] 2026-12-06 17:57:05.521189[Thread 0x00007f9f91fa78c0]:commit_user_preset2107 load config successful and preset name is:BaseParent
[info] 2026-12-06 17:57:05.521208[Thread 0x00007f9f91fa78c0]:load_presets: loaded 1 presets from "/workspace/work/wt/18175/repro/run2/user/default/process/base", type process
[error] 2026-12-06 17:57:05.522359[Thread 0x00007f9f91fa78c0]:can not find parent ReproParent for config /workspace/work/wt/18175/repro/run2/user/default/process/AAAChild.json!
[info] 2026-12-06 17:57:05.522401[Thread 0x00007f9f91fa78c0]:commit_user_preset load preset: ZebraChild and filament_id: and base_id:
[info] 2026-12-06 17:57:05.522408[Thread 0x00007f9f91fa78c0]:set_printer_hold_alias preset name : ZebraChild remove action: false insert success: true remove success: false alias: ZebraChild
[info] 2026-12-06 17:57:05.522412[Thread 0x00007f9f91fa78c0]:set_printer_hold_alias preset name : ZebraChild remove action: false insert success: true remove success: false alias: ZebraChild
[info] 2026-12-06 17:57:05.522416[Thread 0x00007f9f91fa78c0]:set_printer_hold_alias preset name : ZebraChild remove action: false insert success: true remove success: false alias: ZebraChild
[info] 2026-12-06 17:57:05.522420[Thread 0x00007f9f91fa78c0]:commit_user_preset2107 load config successful and preset name is:ZebraChild
[info] 2026-12-06 17:57:05.522442[Thread 0x00007f9f91fa78c0]:load_presets: loaded 3 presets from "/workspace/work/wt/18175/repro/run2/user/default/process", type process
{
"from": "User",
"inherits": "0.20mm Standard @MyKlipper",
"name": "ReproParent",
"print_extruder_id": [
"1",
"1",
"1"
],
"print_extruder_variant": [
"Direct Drive Standard",
"Direct Drive High Flow",
"Direct Drive Extra High Flow"
],
"print_settings_id": "ReproParent",
"version": "2.4.0.10"
}
{
"from": "User",
"inherits": "ReproParent",
"name": "ReproChild",
"print_extruder_id": [
"1",
"1",
"1"
],
"print_extruder_variant": [
"Direct Drive Standard",
"Direct Drive High Flow",
"Direct Drive Extra High Flow"
],
"print_settings_id": "ReproChild",
"version": "2.4.0.10"
}
{
"compatible_printers": [
"MyKlipper 0.4 nozzle"
],
"filament_extruder_variant": [
"Direct Drive Standard",
"Direct Drive High Flow",
"Direct Drive Extra High Flow",
"Bowden Standard",
"Bowden High Flow",
"Bowden Extra High Flow"
],
"filament_settings_id": [
"ReproFilParent"
],
"from": "User",
"inherits": "Generic PLA @System",
"name": "ReproFilParent",
"version": "2.4.0.31"
}
{
"compatible_printers": [
"MyKlipper 0.4 nozzle"
],
"filament_extruder_variant": [
"Direct Drive Standard",
"Direct Drive High Flow",
"Direct Drive Extra High Flow",
"Bowden Standard",
"Bowden High Flow",
"Bowden Extra High Flow"
],
"filament_settings_id": "ReproFilChild",
"from": "User",
"inherits": "ReproFilParent",
"name": "ReproFilChild",
"version": "2.4.0.31"
}
{
"from": "User",
"inherits": "",
"name": "ReproChild",
"print_extruder_id": [
"1",
"1",
"1"
],
"print_extruder_variant": [
"Direct Drive Standard",
"Direct Drive High Flow",
"Direct Drive Extra High Flow"
],
"print_settings_id": "ReproChild",
"version": "2.4.0.10"
}