Fix deep-scan bugs across RHI, engine, networking, editor, and game m…#487
Merged
Conversation
…odules Targeted fixes for real bugs surfaced by a cross-codebase deep scan. Every finding was re-verified against the actual source; a large fraction were false positives (math-convention misreads, already-guarded call sites, pre-existing error checks) and are not touched. This commit addresses the genuine issues only. Graphics / RHI - VulkanDevice: check vkAllocateCommandBuffers / vkMapMemory return codes and clean up staging buffer/memory on failure; add VkImage+memory rollback if vkCreateImageView fails; replace UINT64_MAX vkWaitForFences with a 10s bounded timeout on the upload/copy paths; reject unknown texture formats in UpdateTexture instead of assuming 4 bytes/pixel; null-check mapped pointer before memcpy in UpdateBuffer; extend BPP table (R8G8B8A8/B8G8R8A8) and log-and-return on unmapped formats. - D3D12Device: guard SRV/UAV/RTV/DSV creation with DescriptorAllocation IsValid() checks; bounds-check descriptor-heap free-list pops; check QueryInterface result in WrapNativeTexture. - OpenGLDevice: XFree fbConfigs on the error-return path of glXChooseFBConfig. - PostProcessingPipeline: extend early-out null-check to include m_sharpenPS and m_constantBuffer in Render(). Engine core - TweenSystem: fix PingPong reverse-leg stalling at t=0 by seeding m_elapsed with m_duration and using direction-aware reachedEnd. - NavMesh: raise near-zero denominator threshold 1e-10f -> 1e-6f in triangle containment. - ECSystems: raise Doppler velocity dt epsilon from >0 to >1e-6. - AnimationSystem: check file.good() after version read; bail on IO failure. - SaveSystem: SafeGetString now logs a warning before truncating. - SkeletalAnimation: normalize the slerp result in BlendTransforms. Networking / streaming - NetworkManager: reorder payload-length validation to be overflow-safe. - UDPTransport: check setsockopt return codes on SO_SNDBUF/SO_RCVBUF and warn on failure. - AsyncDatabase: wrap worker body in try/catch and propagate the exception via promise.set_exception so callers' futures don't hang. - DirectStorageLoader: stop detaching async-load threads; track them in a member vector joined at destruction; handle-id wrap skips 0; allow cancel while InProgress via an atomic cancelled flag; tighten readOffset == fileSize edge case. - EntityReplicator: return false on partial/failed ProcessIncoming. - MobilePlatform: drop existing touch with same id before pushing a new Began event. - ReplaySystem: guard UpdatePlayback against dt <= 0. - NetworkIntegration: unbreak the header - align with real NetworkSecurity API (Token, GenerateConnectionToken, ValidateConnectionToken, static Encrypt/Decrypt(data, key)) and drop the stale encryptionKey/tokenLifetimeSeconds config fields. Editor / scripting / utils - NeuralWeights: check fwrite return on every write and fail the save cleanly. - LockFreeRingAllocator: replace raw new[]/delete[] with unique_ptr storage. - BenchmarkFramework: check for ftell == -1 before using the size. - CollaborativeEditSession: switch lock-cleanup loop to std::erase_if. - ScriptHotReload: use string::ends_with for the extension check. GameModules - GravitySystem (FPS): raise radial-distance epsilon; use numeric_limits<int>::lowest() as the priority seed. - RPGCharacterSystem: compute XP cost in double and clamp to uint32 max; guard ratio divisions by max health/mana. - PlatformerPlayerController: HandleDash now uses the passed fixedDeltaTime instead of a hardcoded 1/60. - ClassSystem / LootSystem (FPS): reverse narrowing size_t <-> int comparison. - MMOAccountSystem: rewrite CleanExpiredSessions with std::erase_if. - MultiplayerSystem (FPS): reject NaN/negative dt in UpdateProjectiles. Tests: 5589 / 5591 passed locally (1 flaky, pre-existing). LagCompensator RewindToTime deliberately accepts negative times (returns earliest snapshot) - no input guard added there. https://claude.ai/code/session_01FmorWVEJVs9GeGQtpuXNvH
Contributor
❌ CI Error ReportFailed jobs: clang-tidy, coverage, linux-asan, linux-clang-Release, linux-gcc-Debug, linux-msan, linux-tsan, macos-Debug, macos-Release, windows-vs2022-Release Build Errors
Other errors (1)Full error output
|
| Test | Jobs |
|---|---|
| [15:57:29.977] [TID:7924] [WARN ] [Network ] RCON unknown command: nonexistent_cmd (DedicatedServer.cpp:573) | windows-vs2022-Release |
| [15:57:29.993] [TID:7924] [WARN ] [Network ] NetBuffer::ReadUint8 — buffer overrun at pos 1 (size=1) (NetworkBuffer.c... | windows-vs2022-Release |
Compiler Warnings (3)
../SparkEngine/Source/Physics/PhysicsBodyImpl.cpp:270:23: warning: comparing floating point with == or != is unsafe [-Wfloat-equal] [linux-msan]
../SparkEngine/Source/Physics/PhysicsSystem.cpp:401:12: warning: use of old-style cast [-Wold-style-cast] [linux-msan]
../../Tests/TestReliableChannel.cpp:390:9: warning: variable 'retransmitCount' set but not used [-Wunused-but-set-variable] [linux-msan]
Updated: 2026-04-17T15:57:56Z — this comment is updated in-place, not duplicated.
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.
…odules
Targeted fixes for real bugs surfaced by a cross-codebase deep scan. Every finding was re-verified against the actual source; a large fraction were false positives (math-convention misreads, already-guarded call sites, pre-existing error checks) and are not touched. This commit addresses the genuine issues only.
Graphics / RHI
Engine core
Networking / streaming
Editor / scripting / utils
GameModules
Tests: 5589 / 5591 passed locally (1 flaky, pre-existing). LagCompensator RewindToTime deliberately accepts negative times (returns earliest snapshot) - no input guard added there.
https://claude.ai/code/session_01FmorWVEJVs9GeGQtpuXNvH