Skip to content

fix(h3): abortar si la malla sigue por encima del tope de cuelgue - #18

Merged
IAnMove merged 2 commits into
mainfrom
cursor/critical-bug-management-de36
Aug 29, 2026
Merged

fix(h3): abortar si la malla sigue por encima del tope de cuelgue#18
IAnMove merged 2 commits into
mainfrom
cursor/critical-bug-management-de36

Conversation

@cursor

@cursor cursor Bot commented Aug 26, 2026

Copy link
Copy Markdown

El hang-fix de Hunyuan3D (#14) añadió guard_mesh_complexity para no texturizar/exportar mallas de cientos de miles de caras. Esa red de seguridad delegaba en reduce_faces(), que traga cualquier excepción (OOM, topología incompatible, FaceReducer de v2 sobre una malla v2.1) y devuelve la malla original.

Impacto
Quality/PBR (octree 384+) que genera >200k caras: si FaceReducer falla, el worker registra Mesh simplification skipped y sigue a Paint/export con la malla densa. Eso pincha CPU/RAM y bloquea el driver GPU — exactamente la clase de cuelgue que #14 intentaba cerrar.

Cómo reproducir

  1. Generar un modelo Quality/PBR con octree alto.
  2. reduce_faces lanza (OOM o postprocesador incompatible).
  3. El worker no aborta; textura/exporta la malla completa y el host se congela.

Qué cambia

  • Tras simplificar, si la malla sigue por encima del tope de cuelgue (200k textura / 400k export), el job falla en vez de continuar.
  • El tope de usuario (reduce_face / target_face_num) sigue siendo best-effort: solo se aborta cuando se supera el límite que congela el host.

Validación
pytest tests/test_model3d_hang_guards.py — 8 passed.

Open in Web View Automation 

Note

Medium Risk
Changes failure behavior on the critical path before GPU-heavy texturing/export; jobs that previously hung the host will now fail fast, which is intentional but affects high-octree quality runs when simplification fails.

Overview
Hunyuan3D mesh guarding no longer continues into texturing/export when face reduction cannot bring the mesh under the host hang limits (200k for texture, 400k for export).

guard_mesh_complexity now distinguishes the target face count (user reduce_face / target_face_num, capped by the hang limit) from the hang_limit itself. After calling best-effort reduce_faces (which may return the original mesh on error), it raises RuntimeError if the face count is still above hang_limit, with guidance to lower octree resolution instead of freezing the machine.

A new unit test asserts this fail-closed path when reduce_faces returns an unchanged oversized mesh.

Reviewed by Cursor Bugbot for commit f4acade. Configure here.

reduce_faces tragaba cualquier error y devolvía la malla original.
El hang-fix llamaba a eso como red de seguridad, así que Quality/PBR
con >200k caras seguía a textura/export si FaceReducer petaba y
congelaba el host. Ahora el guardia aborta el job en ese caso.

Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
@github-actions

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: low
Scope: 2 file(s); +32/-5; backend services

Automated review from scripts/analyze_pr.py. This is a heuristic pass (no LLM) so humans still own the merge decision.

Findings

  • No heuristic issues. Still run the CI checklist below.

Changed files

  • modified: app/services/hunyuan3d/worker.py, tests/test_model3d_hang_guards.py

CONTRIBUTING checklist

  • python scripts/verify_clean_repo.py
  • python -m compileall -q app/services app/launch.py scripts
  • cd ui && npm run build if the UI changed
  • No weights, CivitAI sidecars, or generated guides
  • Stays local-first (no required accounts / telemetry)

Posted by the repo PR review workflow. Re-runs on each push to the PR.

…anagement-de36

Co-authored-by: THEINAOG <IAnMove@users.noreply.github.com>
@IAnMove
IAnMove marked this pull request as ready for review August 29, 2026 12:14

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. No apruebo: el check Cursor Bugbot quedó en skipping y no hay una señal Bugbot completa. Asigné revisor para revisión humana.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor
cursor Bot requested a review from IAnMove August 29, 2026 12:19

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Left a non-blocking comment: Cursor Bugbot was present and finished as skipped, so this run does not approve. Human review is needed; a reviewer was assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@IAnMove
IAnMove merged commit bd1c4f0 into main Aug 29, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants