# 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` (`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.