Split raw and encoded texture payload sources#320
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors texture import plumbing by splitting in-memory texture sources into explicit raw RGBA32 vs encoded-image variants, and tightens constructors so raw in-memory payloads always include dimensions (eliminating a runtime failure path during materialization).
Changes:
- Replaced the unified in-memory texture source with
CreateRawRgba32InMemory(...)andCreateEncodedImageInMemory(...). - Updated
TexturePayloadandResoniteTexturePayloadconstructors to require non-nullwidth/heightfor raw payloads and to default source-backed payloads to encoded-image. - Updated affected tests and diagnostics utilities, and added coverage ensuring raw constructors create dimensioned raw sources.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/PlateauResoniteLink.Tests/TextureImportSourceTestFactory.cs | Switches raw test texture creation to the new raw in-memory factory method. |
| tests/PlateauResoniteLink.Tests/Targets/SceneImportContractMapperTests.cs | Updates contract mapper test to construct encoded-image payloads via an encoded in-memory source. |
| tests/PlateauResoniteLink.Tests/Targets/ResoniteTexturePayloadTests.cs | Adds coverage ensuring the raw ResoniteTexturePayload ctor produces a dimensioned raw source. |
| tests/PlateauResoniteLink.Tests/Targets/ResoniteLiveSceneImportTargetTestSupport.cs | Updates contract payload conversion to the new raw/encoded construction paths. |
| tests/PlateauResoniteLink.Tests/Application/TexturePayloadTests.cs | Adds coverage ensuring the raw TexturePayload ctor produces a dimensioned raw source. |
| src/PlateauResoniteLink/Targets/Resonite/SceneImportContractMapper.cs | Updates mapping logic to select raw-vs-encoded payload construction paths. |
| src/PlateauResoniteLink/Targets/Resonite/ResoniteTexturePayload.cs | Makes raw payload construction dimension-required and removes format selection from constructors. |
| src/PlateauResoniteLink/Targets/Resonite/ResoniteTextureImportFactory.cs | Updates payload creation call-site to new raw constructor signature. |
| src/PlateauResoniteLink/Targets/Resonite/Diagnostics/CanonicalSceneDumpSink.cs | Switches canonical dump texture creation to the new raw in-memory factory method. |
| src/PlateauResoniteLink/Application/Importing/TextureImportSource.cs | Splits InMemoryTextureImportSource into raw vs encoded implementations and exposes new factory helpers. |
| src/PlateauResoniteLink/Application/Importing/SceneImportContractTypes.cs | Makes raw contract payload construction dimension-required and removes format selection from constructors. |
| src/PlateauResoniteLink/Application/Importing/CityGmlAppearanceStore.cs | Updates dataset-backed texture payload construction to the encoded-image-only constructor path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a304fa7dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
これはマージ可能です。raw RGBA と encoded image を分け、dimension 不明の raw payload が materialization まで流れないなら価値があります。 条件は、作成境界で |
|
レビュー結論: 受け入れ不可です。 raw bytes constructor で payload の |
|
レビュー対応しました。
検証:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a062d537ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
追加レビュー対応しました。
検証:
|
|
レビュー結論: 現時点では受け入れ不可です。 未解決 thread の この点が未解決のままでは、境界を締めるメリットに対して性能退行リスクを受け入れられません。 |
ed1067d to
ebf09ba
Compare
| @@ -14,4 +19,109 @@ public void ConstructorCopiesBinaryPayloadBytes() | |||
|
|
|||
| Assert.Equal<byte>([4, 3, 2, 1], payload.BinaryPayload); | |||
There was a problem hiding this comment.
このテスト群は contract 側 TexturePayloadTests とかなり重複しています。raw shape 拒否、source identity、dimensioned raw source などは TexturePayload と ResoniteTexturePayload の両方にほぼ同じ形で追加されており、PR全体では test だけで +237 行増えています。
raw/encoded source 分離の価値はありますが、コード量抑制を前提にすると、この重複テストをそのまま受け入れるだけの必然性は弱いです。target 側で本当に固めるべきなのは contract round-trip や Resonite 固有変換だけに絞り、共通の raw payload/source 境界は shared helper/theory か application 側テストに寄せて、同じ仕様を2ファイルに固定しないでください。
|
この PR は閉じます。後続の #356 で raw/encoded/RGBA32/HDR の source/payload variant 化を小さい差分と focused tests で実装し直しました。この PR の target-side test 重複や広い差分はレビュー指摘どおり残す価値が低いため、後続 stack を採用します。 |
Summary
Verification