Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
Merge origin/feat/test-flow-2 b3a7811d: tiered test flow (its REPORT.md left out)
islandmeda4146bb14e9f
diff --cc CMakeLists.txtindex 7c988f8d,c44c0bad..bad0c9b5--- a/CMakeLists.txt+++ b/CMakeLists.txt@@@ -767,8 -714,16 +776,15 @@@ if(SCULPTFORGE_BUILD_TESTSfile(GLOB SCULPTFORGE_UI_TESTS CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/ui/*.sfui)foreach(script ${SCULPTFORGE_UI_TESTS})get_filename_component(name ${script} NAME_WE)- add_test(NAME ui_${name} COMMAND sculptforge --ui-test ${script} --ui-out ${CMAKE_CURRENT_BINARY_DIR}/ui-shots/${name})- set_tests_properties(ui_${name} PROPERTIES LABELS ui TIMEOUT 300)+ sculptforge_ui_test(${name} ${name})endforeach()+ # Heavy-mesh and benchmark scripts (tests/perf/*.sfui, e.g. 33M-triangle precision): nightly only (T3).+ file(GLOB SCULPTFORGE_PERF_TESTS CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/perf/*.sfui)+ foreach(script ${SCULPTFORGE_PERF_TESTS})+ get_filename_component(name ${script} NAME_WE)+ add_test(NAME perf_${name} COMMAND sculptforge --ui-test ${script} --ui-out ${CMAKE_CURRENT_BINARY_DIR}/ui-shots/perf_${name})+ set_tests_properties(perf_${name} PROPERTIES LABELS "ui;nightly" TIMEOUT 3600 RUN_SERIAL TRUE)+ endforeach()# Splat training (also started by a phone scan) runs the fake Brush / COLMAP / ffmpeg.foreach(t ui_splat_train ui_phone_link)if(TEST ${t})diff --cc src/app/App.cppindex a55dcd13,c15a9318..e7ac1ee2--- a/src/app/App.cpp+++ b/src/app/App.cpp@@@ -281,13 -256,18 +281,21 @@@ bool App::init(const AppOptions& optionai::defaultGeneratorCommand(std::string(base) + cliName).c_str());}initHardwareProfile(); // the cached hardware profile, or calibration over the first frames (PanelPerformanceProfile.cpp)+ timer.step("hardware profile");+ initialised_ = true;return true;}void App::shutdown() {+ if (!initialised_) { // init stopped early (no window or no OpenGL): nothing but SDL to take down++ if (sharedWindow_) return; // --ui-serve: the server's window, context and SDL stay+ if (glContext_) SDL_GL_DestroyContext(glContext_);+ if (window_) SDL_DestroyWindow(window_);+ SDL_Quit();+ return;+ }saveWindowState();+ discordClient_.reset(); // clears what Discord shows, then closesif (doc_.sculptor.strokeActive()) endStroke();solver_.reset(); // (its thread uses the renderer)flushBrushEdits();@@@ -467,18 -408,10 +475,19 @@@ int App::runUiTest(int w, int h, int fpimg.rgba = rgba;for (size_t i = 3; i < img.rgba.size(); i += 4) img.rgba[i] = 255;demo_->setLastShot(img.rgba, w, h);- if (!img.savePng(shot, err)) SDL_Log("%s", err.c_str());- else SDL_Log("Screenshot %s", shot.c_str());+ // The PNG compresses on another thread while the script goes on (encoding was a fifth of the UI tests' time).+ if (shotWrites.size() >= 4) {+ shotWrites.front().get();+ shotWrites.erase(shotWrites.begin());+ }+ shotWrites.push_back(std::async(std::launch::async, [img = std::move(img), shot] {+ std::string error;+ if (!img.savePng(shot, error)) SDL_Log("%s", error.c_str());+ }));+ SDL_Log("Screenshot %s", shot.c_str());}+ for (auto& write : shotWrites) write.get(); // every screenshot on disk before the verdict+ demo_->printProfile();for (const auto& f : demo_->failures()) std::fprintf(stderr, "FAIL %s\n", f.c_str());if (demo_->failures().empty())std::printf("PASS %s (%d frames)\n", options_.uiTest.c_str(), frames);diff --cc src/app/App.hindex 1d64ca87,dddb1ec0..d25b8ec5--- a/src/app/App.h+++ b/src/app/App.h@@@ -242,8 -236,7 +242,9 @@@ privateSDL_Window* window_ = nullptr;SDL_GLContext glContext_ = nullptr;+ static inline SDL_Window* sharedWindow_ = nullptr; // shareWindow+ static inline SDL_GLContext sharedContext_ = nullptr;+ bool initialised_ = false; // init() got to the end (shutdown() takes down only what it made otherwise)bool running_ = true;std::string iniPath_;diff --cc tests/TestHarness.hindex 90756fdc,0625f76a..83ef07fa--- a/tests/TestHarness.h+++ b/tests/TestHarness.h@@@ -59,17 -59,13 +59,21 @@@ inline bool inShard(const char* name, iinline double timeLimit(double local) {const char* strict = std::getenv("SF_BENCH_LIMITS");if (strict && std::string(strict) == "1") return local;- return std::getenv("CI") || std::getenv("GITHUB_ACTIONS") ? local * 4.0 : local;+ if (std::getenv("CI") || std::getenv("GITHUB_ACTIONS")) return local * 4.0;+ // tools/test/run.py sets SF_TIME_LIMIT_SCALE for a parallel run (ctest -jN): the machine is as loaded as CI's.+ const char* scale = std::getenv("SF_TIME_LIMIT_SCALE");+ const double k = scale ? std::atof(scale) : 0.0;+ return k > 1.0 ? local * k : local;}+// Tests that open real network connections (WebRTC peers over the machine's interfaces) return early with+// SF_TEST_NO_NETWORK=1: the release package jobs (.github/workflows/packages.yml) set it, because a runner's network+// can stall them (ar_link_sends_the_model_over_webrtc timed out on the Windows runner); CI and local runs keep them.+inline bool networkTestsOff() {+ const char* off = std::getenv("SF_TEST_NO_NETWORK");+ return off && std::string(off) == "1";+}+inline std::string tempPath(const char* name) { return (std::filesystem::temp_directory_path() / name).string(); }} // namespace sf::test