Propagate write and parse failures instead of swallowing them - #56
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
Propagate write and parse failures instead of swallowing them#56devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
Exporters used stdio/ofstream without checking the sticky error flag or fclose, so a full disk or I/O error produced a truncated file and reported success. Recipe loading accepted malformed face/edge/scale/weld lines and bound them to face 0 or silently reset the value. The CLI discarded the applyOps report, so recorded ops that failed to replay were dropped without a word. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Without libglfw3-dev the app fetches GLFW 3.4 and its Wayland backend needs wayland-scanner, which the runner lacks, so configure fails before anything is compiled. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…n run Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four places reported success while losing data. Audit of the error paths in the
export, recipe, and CLI layers; no behavior changes on the success path.
1. Every mesh exporter ignored write failures.
std::fopen+fwrite/fprintf+fclosereport a failed write only through the sticky error flagand
fclose's return, and buffered bytes reach the disk atfclose— so afull disk or I/O error produced a truncated OBJ/MTL/GLB/STL and the CLI printed
in.step -> out.obj. Newcore/src/out_file.hppwraps the handle:The destructor also removes the file when the writer unwinds, so a partial
export is never published as a good one.
writeFbx(anofstream) andsaveRecipeget the same treatment: check after an explicitclose(), deletethe partial file, throw.
2.
loadRecipeaccepted malformed lines.ss >> fid >> list/ss >> eid >> countwere unchecked, soface oops radial=8silently bound theoverride to face 0, and a bad
scale/weldvalue silently reverted to thedefault — regenerating a mesh that was not the one the recipe described. Those
lines now throw like the
oplines already did, and the existing handlerprefixes
path:line:. Out-of-range (non-positive scale, negative tolerance)still clamps as before; only unparsable input is rejected.
3. The CLI discarded the
applyOpsreport.weft::applyOps(mesh, model, recipe.ops);— the{applied, failed}result was dropped at both call sites(main path and each LOD tier), so recorded ops that no longer replay were
dropped from the export without a word. Now warns on stderr with the count.
Exit codes are unchanged so the corpus gates keep their current semantics.
4.
tessellate()could return an empty mesh as success. BRepMesh signalsper-face failure by leaving the face without a triangulation, and every face
was
continued over silently;weft convert <brep> <mesh>then wrote ageometry-free file and reported success. Skipping some faces is still allowed
(lossy but usable); triangulating none now throws.
New test
testRecipeLoadRejectsMalformedLinescovers the recipe parse strictnessand that valid overrides still load.
Not changed: the app's
catch-to-status-line handlers (correct for a GUI — theartist sees the message and keeps their session) and the mesher's per-face
isolation in
meshers.cpp, which already attributes failures throughbuildCause/GenerationReport.Link to Devin session: https://app.devin.ai/sessions/b8f76bf0032c4f178ec7d250b1e97e3f
Requested by: @jmossymoss