Open
Conversation
…sting Hardens several runtime paths that crash or produce NaN state when fed unexpected input from users, corrupted assets, or zero-delta frames. Console commands — unguarded std::stof would throw and terminate the engine's command thread on non-numeric input: - weather_set intensity/transition - fov (camera FOV update) - vr_renderscale - autosave_interval Console commands — out-of-bounds array index when state/enum value exceeds name-table size: - weather_info (WeatherType) - accessibility_info (colorblindMode) - vr_info (trackingSpace, comfortMode) Runtime hot paths: - SkeletalAnimation::SampleClip: bounds-check boneIdx against outLocalTransforms.size() before indexing. A cached channel.boneIndex can outlive the producing skeleton (retargeting, runtime swap, bad clip data) and previously wrote past the end of the transform array. - ClothSimulation::IntegratePositions: skip integration on zero-delta ticks. The velocity formula (pos - prevPos) / dt would otherwise compute NaN on the first tick and poison downstream consumers. Also removes a dead Vulkan->OpenGL fallback block in SparkEngineLinux.cpp that ran before GraphicsEngine was constructed and so never executed. SDL2 submodule pointer updated to release-2.30.0 so the checkout matches what ThirdParty/SDL2/CMakeLists.txt expects (earlier state pointed at an unrelated SDL3 commit and broke configure). All 5863 SparkTests pass. Engine -headless and SparkEditor --test-mode both run clean under Xvfb/gVisor.
The Vulkan->OpenGL fallback block in RunSDL2Windowed was removed in the prior pass because it ran *before* GraphicsEngine was constructed, so GetEngineRuntime().graphics was always null and the branch could never detect a real fallback. Add it back correctly. - Split graphics init out of InitializeSDL2Subsystems into a new InitializeGraphicsForWindow helper. Caller (RunSDL2Windowed) now owns the "construct + Initialize GraphicsEngine" step. - Drop the no-longer-needed nativeRenderHandle parameter from InitializeSDL2Subsystems. - After the first graphics init, if Vulkan was requested but RHIBridge selected a non-Vulkan, non-headless backend (e.g. OpenGL), tear the graphics + SDL window down, rebuild windowFlags with SDL_WINDOW_OPENGL, recreate the window + GL context, and re-run graphics init. The check uses GraphicsEngine::GetRHIDevice()->GetBackendType() and GetRHIBridge()->IsHeadless(), both of which require an initialized graphics engine. Headless and Vulkan-ok paths are unchanged. Build and all 5863 SparkTests still pass.
Running the engine under gVisor / sandboxed hosts without libEGL.so.1 caused RunSDL2Windowed to exit with -1 after only logging up to "recommended backend = None". Root cause: SDL2's offscreen video driver dlopen()s libEGL during SDL_CreateWindow; on hosts where libEGL is absent the process exits with -1 mid-window-creation without surfacing an error through SDL_GetError(). The `if (!window) return -1;` branch was never even reached. - If RHIBridge::GetRecommendedBackend() returns GraphicsBackend::None (no usable GPU backend), skip SDL_CreateWindow entirely and run the engine windowless on NullRHIDevice. - Demote SDL_CreateWindow failure from fatal (return -1) to a warning; fall through into the same windowless / NullRHIDevice path so the engine comes up instead of exiting cold. - Skip Metal-view / GL-context creation when window is null. - Guard SDL_SetWindowTitle against a null window. End-to-end smoke test: engine now initializes, runs test frames, and shuts down cleanly (exit 0, ~321 log lines) in a libEGL-less gVisor environment where it previously exited after 6 log lines. All 5863 SparkTests still pass.
Following the SDL_CreateWindow guard, apply the same "log warning + run on NullRHIDevice" pattern to three more brittle init paths in RunSDL2Windowed so the engine keeps coming up on constrained hosts instead of exiting with -1. - SDL_Init failure: previously `return -1`. Now logs a warning, sets sdlInitOk=false, forces noGpuBackend=true, and skips all subsequent SDL calls. Vulkan detection, SDL_GetCurrentVideoDriver, GL attribute setup, SDL_Quit, and SDL_Vulkan_UnloadLibrary are all gated on sdlInitOk. ShouldPreferMetal() is short-circuited to false. - RunSDL2MainLoop now takes `pollSdlEvents`; when false (SDL_Init failed) it runs a pure tick loop without SDL_PollEvent so the engine still honors SIGINT / -test-frames without touching uninitialized SDL state. - Metal-view creation failure (macOS): previously `return -1`. Now logs a warning, destroys the Metal window, clears preferMetal, and lets the rest of the function fall through to the windowless / NullRHIDevice path (matching the noGpuBackend branch added earlier). - Vulkan->OpenGL fallback: when the second-chance SDL_CreateWindow call also failed it returned -1. Now logs a warning, keeps window=null, and InitializeGraphicsForWindow(null) will bring up NullRHIDevice. - Cleanup guards: `SDL_DestroyWindow(window)` only runs when window is non-null; SDL_Quit/SDL_Vulkan_UnloadLibrary only run when sdlInitOk. The common theme across all four patches: environmental failures that the rest of the stack can absorb (graphics stack already has a NullRHIDevice fallback, main loop can run without SDL events) should not be fatal. Whole-engine aborts were the blast radius of a missing library or a sandboxed display. All 5863 SparkTests still pass. End-to-end smoke run with SDL_VIDEODRIVER=invalid-driver still produces exit 0 and a clean shutdown.
1. ProjectBrowserPanel.cpp: add <shlobj.h> (for CSIDL_PERSONAL and SHGetFolderPathA) and <windows.h> under _WIN32. 2. PostProcessingPipeline.cpp: the six D3D11 functions (CreatePingPongTargets, CreatePostProcessShaders, CompileEffectShaders, BeginPass, DrawFullscreen, ProcessPass) have canonical implementations in PostProcessingPipelineWindows.cpp. Guard the stub copies here with #ifndef SPARK_PLATFORM_WINDOWS so we don't emit LNK4006 duplicate-definition warnings on Windows while still providing stubs on Linux/macOS. 3. SparkInstaller/CMakeLists.txt: switch MSVC_RUNTIME_LIBRARY from MultiThreaded[Debug] (static /MT[d]) to MultiThreaded[Debug]DLL (/MD[d]) to match the imgui target (cmake/BuildImGui.cmake). The CRT mismatch was producing LNK2019 unresolved __imp_* symbols when linking imgui.lib.
Contributor
❌ CI Error ReportFailed jobs: clang-tidy, macos-Debug-OpenGL, macos-Release-Metal, macos-Release-OpenGL, windows-vs2022-Release Build Errors
Other errors (3)Full error output
|
| Test | Jobs |
|---|---|
| [01:17:25.877] [TID:8888] [WARN ] [Network ] RCON unknown command: nonexistent_cmd (DedicatedServer.cpp:573) | windows-vs2022-Release |
| [01:17:25.892] [TID:8888] [WARN ] [Network ] NetBuffer::ReadUint8 — buffer overrun at pos 1 (size=1) (NetworkBuffer.c... | windows-vs2022-Release |
| [01:17:25.913] [TID:8888] [WARN ] [AI ] BuildNavMeshWithRecast: empty geometry (RecastDetourBackend.cpp:35) | windows-vs2022-Release |
| [01:17:25.913] [TID:8888] [WARN ] [AI ] NavMeshBuilder: Recast build failed, falling back to triangle-soup builder (N... | windows-vs2022-Release |
| [01:17:25.913] [TID:8888] [WARN ] [Audio ] XAudio2 backend requested but no AudioEngine provided, falling back to Nul... | windows-vs2022-Release |
| [ OK ] FixedTimest[01:17:25.931] [TID:8888] [WARN ] [Graphics ] No graphics backend available — falling back to NullR... | windows-vs2022-Release |
| [01:17:25.931] [TID:8888] [WARN ] [Graphics ] No graphics backend available — falling back to NullRHIDevice (headless... | windows-vs2022-Release |
| [01:17:25.936] [TID:8888] [WARN ] [Editor ] Cannot host: userName is empty. (CollaborativeEditSession.cpp:454) | windows-vs2022-Release |
| [01:17:25.936] [TID:8888] [WARN ] [Editor ] Already connected. (CollaborativeEditSession.cpp:459) | windows-vs2022-Release |
| [01:17:25.939] [TID:8888] [WARN ] [Editor ] BroadcastEdit rejected: nodeId is empty. (CollaborativeEditSession.cpp:1108) | windows-vs2022-Release |
| [01:17:25.939] [TID:8888] [WARN ] [Editor ] BroadcastEdit rejected: sourceEditor is not set. (CollaborativeEditSessio... | windows-vs2022-Release |
| [01:17:25.940] [TID:8888] [WARN ] [Editor ] SetLocalSelection rejected: nodeId exceeds 255 chars (length=300). (Colla... | windows-vs2022-Release |
| [01:17:31.517] [TID:8888] [WARN ] [Network ] Connection rejected for pending client 5: server full (4/4) (NetworkConn... | windows-vs2022-Release |
| [01:17:31.518] [TID:8888] [WARN ] [Network ] Connection rejected for pending client 5: server full (4/4) (NetworkConn... | windows-vs2022-Release |
| [01:17:31.521] [TID:8888] [WARN ] [Network ] Invalid packet magic 0x6A0E5CB3 (expected 0x5350524B) (NetworkManager.cp... | windows-vs2022-Release |
Compiler Warnings (7)
../../../ThirdParty/SDL2/ rc/event /SDL_quit.c:81:41: warning: ca t from 'void (*)(int, truct __ iginfo *, void *)' to 'void (*)(int)' convert to incompatible function type [-Wca t-function-type-mi match] [macos-Debug-OpenGL, macos-Release-Metal, macos-Release-OpenGL]
../../../ThirdParty/SDL2/ rc/joy tick/iphoneo /SDL_mfijoy tick.m:489:27: warning: 'gamepad' i deprecated: fir t deprecated in macOS 10.12 [-Wdeprecated-declaration ] [macos-Debug-OpenGL, macos-Release-Metal, macos-Release-OpenGL]
../../../ThirdParty/SDL2/ rc/joy tick/iphoneo /SDL_mfijoy tick.m:782:24: warning: 'controllerPau edHandler' i deprecated: fir t deprecated in macOS 10.15 - U e the Menu button found on the controller' input profile, if it exi t . [-Wdeprecated-declaration ] [macos-Debug-OpenGL, macos-Release-Metal, macos-Release-OpenGL]
../../../ThirdParty/SDL2/ rc/joy tick/iphoneo /SDL_mfijoy tick.m:1234:13: warning: 'GCGamepad' i deprecated: fir t deprecated in macOS 10.12 [-Wdeprecated-declaration ] [macos-Debug-OpenGL, macos-Release-Metal, macos-Release-OpenGL]
../../../ThirdParty/SDL2/ rc/video/cocoa/SDL_cocoaevent .m:188:55: warning: emicolon before method body i ignored [-W emicolon-before-method-body] [macos-Debug-OpenGL, macos-Release-Metal, macos-Release-OpenGL]
../../../ThirdParty/SDL2/ rc/video/cocoa/SDL_cocoametalview.m:82:47: warning: emicolon before method body i ignored [-W emicolon-before-method-body] [macos-Debug-OpenGL, macos-Release-Metal, macos-Release-OpenGL]
../../../ThirdParty/SDL2/ rc/video/cocoa/SDL_cocoamode .m:122:23: warning: 'CGDi playModeCopyPixelEncoding' i deprecated: fir t deprecated in macOS 10.11 - No longer upported [-Wdeprecated-declaration ] [macos-Debug-OpenGL, macos-Release-Metal, macos-Release-OpenGL]
Updated: 2026-04-20T01:18:03Z — this comment is updated in-place, not duplicated.
The libsdl-org/SDL repo's default branch is now SDL3 development. When .gitmodules didn't specify a tracked branch, Dependabot's submodule updater (PR #485, commit 9a0202e) saw "newer" commits on the main/SDL3 branch and bumped ThirdParty/SDL2 from 859844e (SDL 2.30.0) to e4f75ba (SDL 3.5.0 — "Remove SDL_gtk"). That silently broke every fresh clone: SDL3 uses include/SDL3/ (not include/SDL.h) and exposes SDL3/SDL3::SDL3 CMake targets, so the engine's SDL2 target check failed → SparkEditor skipped → SparkLauncher's find_package(SDL2 REQUIRED) hard-errored. The submodule pointer itself was already restored to 859844e on this branch in commit 54ba527. Adding branch = SDL2 here tells Dependabot to only propose bumps from the SDL2 stable branch, preventing future SDL2→SDL3 "bumps". Verified end-to-end: SparkInstaller clone + cmake configure on a fresh tree — SDL2 audit OK, SparkEditor added, SparkLauncher finds SDL2.
Fixes CI check-format failures in HierarchyPanel.cpp, EditorFonts.cpp, and EditorTheme.cpp.
…L options Fixes two CI failures: 1. Linux GCC/Clang: "fatal error: SDL_main.h: No such file or directory" at build/ThirdParty/SDL2/include/SDL2/SDL.h. SDL2 copies its public headers to the build tree via a build-time custom_target (sdl_headers_copy). Consumers that pick up SDL2's INTERFACE_INCLUDE_DIRECTORIES without a direct build-order dep (cached restores, tests reaching SDL.h through SparkEngineLib's PUBLIC include path) can race the copy. Copy the headers eagerly at configure time with configure_file COPYONLY so they are present before any compilation runs. 2. macOS: missing cocoa .m object files at link time (SDL_cocoaevents.m.o, SDL_cocoametalview.m.o, etc.). The root project declared only LANGUAGES CXX C, so CMake silently skipped SDL2's Objective-C sources. Enable OBJC and OBJCXX in project() on Apple platforms so both SDL2's cocoa/.m files and MetalDevice.mm compile. Also stop forcing SDL_X11=ON on macOS — X11 is irrelevant there, and setting it on caused SDL2's configure to probe for X11 headers that don't exist on the macOS runner.
Contributor
Code Coverage (GCC + lcov)Per-Subsystem Coverage
Total: 50.8% (28321/55788 lines) |
Addresses the remaining CI failures surfaced after the SDL2 eager-copy fix got Linux green: - SparkEngine/Source/Audio/OpenALAudioEngine.cpp: include <OpenAL/al.h> on macOS when available. CMake's FindOpenAL picks the system OpenAL.framework, whose headers live at OpenAL/al.h (not AL/al.h). Homebrew's openal-soft still uses AL/al.h, so fall back to that form everywhere else. - SparkEngine/Source/Graphics/RHI/Metal/MetalDevice.mm: include Utils/LogMacros.h (SPARK_LOG_ERROR lives there, not in Logger.h), and replace ++m_statistics.frameCount with ResetStatistics() to match the other RHI backends — RHIStatistics has no frameCount field. - SparkBuild/CMakeLists.txt: drop the per-target /MT[d] override on SparkBuildCore and SparkBuild. The top-level project sets CMAKE_MSVC_RUNTIME_LIBRARY to /MD[d]; forcing /MT[d] here made SparkInstaller (which links both SparkBuildCore and imgui, the latter built /MD[d]) pull in both static and dynamic CRT variants and fail with LNK1169 on VS2022 Debug. - ThirdParty/dependencies.lock: bump Last sync to 2026-04-20 so the check-thirdparty-manifest job accepts the SDL2 .gitmodules / CMakeLists.txt changes.
Contributor
Code Coverage (GCC + lcov)Per-Subsystem Coverage
Total: 50.8% (28327/55788 lines) |
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.
No description provided.