Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Report params eliminated by substitution as free when their substitute is - #1787

Open
jlitewski wants to merge 2 commits into
solvespace:masterfrom
jlitewski:fix-substituted-free-flag
Open

jlitewski wants to merge 2 commits into
solvespace:masterfrom
jlitewski:fix-substituted-free-flag

Conversation

@jlitewski

Copy link
Copy Markdown

Fixes #1786.

Cause. System::Solve() copies the solved values back to SK.param (src/system.cpp). A param that SolveBySubstitution() eliminated already takes its value from the param that replaced it (subMap). Its free flag did not: it copied its own flag instead. MarkParamsFree() only tests params with tag == 0, so a substituted param was always reported as not free. In practice, after Analyze → Show Underconstrained Points, endpoints joined by a horizontal, vertical, or point-coincident constraint showed as fully constrained even though they could still be dragged.

Fix. Copy both val and free from the substitute. subMap already maps every eliminated param to the final survivor of its substitution chain (a = b, b = c → a → c), so chained substitutions are covered. Nothing else changes:

  • the forceDofCheck path (no substitution, empty subMap);
  • the redundant and didn't-converge paths;
  • the values written back.

Tests. Added to test/core/solver/ with a new fixture empty_sketch.slvs (an empty sketch-in-plane group). The geometry is built in code, and the free params are found the same way Show Underconstrained Points finds them:

  • free_params_unconstrained: a free line has all params free.
  • free_params_horizontal, free_params_vertical: all four params stay free. Failed before this change.
  • free_params_coincident: both coincident points are free. Failed before.
  • free_params_coincident_chain: three points joined pairwise by coincident constraints, which chains the substitutions. Failed before.
  • free_params_horizontal_from_fixed_point: the substituted v is pinned through the fixed point, so it must not be reported as free (guards against over-reporting).
  • free_params_fully_constrained: DOF 0, nothing free.
  • free_params_distance_from_fixed_point: the non-substitution case is unchanged.

Results (Debian 13, GCC 14, Release):

Run Result
master 264 cases, 938 checks OK
New tests without the fix 4 failing tests (4 checks)
This branch 272 cases, 973 checks OK

The GUI build compiles. The slvs Python wheel (cp313) builds, and python/tests passes (5 tests).

This is a prerequisite for #1756 (exposing per-entity free state in the library/Python binding), since that would expose these same flags.

@phkahler

Copy link
Copy Markdown
Member

@jlitewski I'll look at this after v3.3 (soon) when we get into things like #1688 and #1621 and the others that attempt the same thing. My goal is to get solvespace #77 done for version 3.4.

@jlitewski

Copy link
Copy Markdown
Author

Sounds good. I've also been tinkering with trying to speed up the solver as well for some concerns in #1756, which is what lead me to this issue and fix. I did have Grok Build make the test because I absolutely hate writing tests in any language, and the various things I had it write tests for personally have been a godsend. I hope you're okay with that 😅

Let me know if there's anything else I can help with. My AuDHD has gotten me back into Python and C++ again, so I want to ride this wave of renewed enjoyment until I burn out 🤣

ayourk added a commit to ayourk/solvespace that referenced this pull request Oct 23, 2026
Brings the fork up to upstream's v3.3 tag and lets it stand on its
own: a library that cannot be mistaken for stock libslvs, a version of
its own, and release builds for more platforms than upstream ships.

- Upstream 3.3: the headless CLI survives a missing linked file,
  constraint text can be selected while editing on Windows, fonts load
  from .ttc collections, a Brazilian Portuguese translation, sanitizer
  builds no longer need the gold linker, and solvespace#1748's solver test. Its
  damped step is not taken: ours (0031, the revision of solvespace#1748) stays,
  because upstream's still fails a case of solvespace#1105's sketch that ours
  solves. The debug tool keeps the fork's additions on top of
  upstream's.
- Ahead of upstream: three open pull requests. A save that fails to
  write now says so instead of claiming success (solvespace#1784); solvespace#1751's
  fallback for tangent line-surface intersections is refined (solvespace#1760);
  and solvespace#1787's tests of free parameters through substitution, a bug the
  fork had already fixed the same way, now guard that fix.
- Library: libslvshc, with pkg-config module slvshc and its header in
  its own directory, not libslvs. Its Slvs_System differs from stock,
  so a program built for one must never load the other, and the two
  install side by side. A program can now ask the library its version
  and check at startup that it matches the header it was built
  against.
- Version: 3.3hc, and 3.3hc.YYYY.MM.DD[.N] for dated builds; configure
  stops when the header's versions fall behind the project's.
- Releases: one workflow for nightlies and tagged releases, beside
  upstream's untouched ones. macOS DMGs per architecture with OpenMP
  linked in, static Windows executables for x86, x64 and arm64, AppImage
  and Flatpak for x86_64 and aarch64, the source, and the Python
  binding as one archive, never PyPI. Windows on Arm builds natively,
  telling two bundled libraries they are not on x86.
- README: where the fork diverges, ahead of upstream's own text, which
  is left unchanged so later merges do not conflict on it; the issue
  template sends everything else upstream.

Origin: upstream v3.3 (30e1c3a), upstream PRs solvespace#1784, solvespace#1760 and solvespace#1787
(tests), and HobbyCAD
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.

Parameters eliminated by substitution never report as free after MarkParamsFree

2 participants