Skip to content

Phase 2 validation#4

Merged
awest813 merged 3 commits into
mainfrom
cursor/phase-2-validation-e71e
Mar 2, 2026
Merged

Phase 2 validation#4
awest813 merged 3 commits into
mainfrom
cursor/phase-2-validation-e71e

Conversation

@awest813
Copy link
Copy Markdown
Owner

@awest813 awest813 commented Mar 2, 2026

Integrate Phase B changes, including GLSL shader normalization and light system improvements, and add comprehensive validation tests.

The MdxComplexInstance.removeLights() method was incorrectly using this.scene instead of the passed scene parameter, which could lead to subtle issues during scene updates. This PR corrects that semantic error.


Open in Web Open in Cursor 

claude and others added 3 commits March 2, 2026 11:37
…r design

B.1 Light-system memory leak fix:
- Scene.update() now calls removeLights(scene) on each instance pruned from
  the active list before discarding it, so LightInstance objects are properly
  unregistered from W3xSceneWorldLightManager. Previously orphaned lights
  accumulated indefinitely, causing memory growth and frame-time drift.
- W3xSceneWorldLightManager.remove() documented as idempotent (ArrayList.remove
  is a no-op for absent elements, preventing state corruption on double-calls).
- W3xSceneWorldLightManager logs active dynamic light count to stdout every
  ~60 s ([LightManager] active dynamic lights=N) for leak verification.

B.2 Shader target normalization:
- vsHd / fsHd upgraded from #version 120 to #version 330 core:
  attribute → in, varying → out/in, texture2D() → texture(),
  gl_FragColor → explicit out vec4 fragColor.
- BONE_TEXTURE_330 helper in MdxShaders provides a #version 330 core-safe
  copy of Shaders.boneTexture (texture2D → texture) used exclusively by vsHd.
- Shaders.transforms updated: attribute → in (used only by vsHd, safe).
- WarsmashTestGame2 and WarsmashTestGame3 test shaders lowered from
  #version 450 core to #version 330 core (no 450-specific features used).

B.3 Parser consolidation design:
- docs/PARSER_CONSOLIDATION_DESIGN.md: unified TableDataSource interface,
  DataTable as canonical backend, adapter layer, migration order, test
  strategy, and open questions. Implementation deferred to Phase C.

Docs: CHANGELOG.md and ENGINE_MODERNIZATION_ANALYSIS.md updated; Phase B
marked complete, Phase C promoted to Next.

https://claude.ai/code/session_015jYzYrpFJctvaAqjpvw6m7
Previously removeLights() ignored the scene parameter and used
this.scene instead. While the values are typically identical, using
the parameter is semantically correct and prevents stale-reference
issues when the instance's scene field is out of sync with the
caller's scene (e.g. during Scene.update() pruning).

Co-authored-by: awest813 <awest813@users.noreply.github.com>
- Configure JUnit 5 dependency and test source set for core module.
- Add MdxShadersTest with 21 assertions validating the GLSL 120->330
  core migration: version directives, keyword replacements (attribute
  -> in, varying -> out, texture2D -> texture, gl_FragColor ->
  fragColor), bone-texture 330 helper, and transforms shared string.
- Update CI workflow to run :core:test after assemble.

Co-authored-by: awest813 <awest813@users.noreply.github.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 2, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@awest813 awest813 marked this pull request as ready for review March 2, 2026 11:47
@awest813 awest813 merged commit a976ff7 into main Mar 2, 2026
7 of 8 checks passed
@awest813 awest813 deleted the cursor/phase-2-validation-e71e branch March 2, 2026 11:47
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.

3 participants