Skip to content

Type Resonite execution contracts#334

Closed
esnya wants to merge 10 commits into
codex/type-scene-import-resolution-planfrom
codex/type-planned-world-references
Closed

Type Resonite execution contracts#334
esnya wants to merge 10 commits into
codex/type-scene-import-resolution-planfrom
codex/type-planned-world-references

Conversation

@esnya
Copy link
Copy Markdown
Owner

@esnya esnya commented Jun 1, 2026

Summary

  • replace nullable multi-field planned slot/world references with closed nested cases
  • route planned reference resolution through case-owned Match methods instead of downstream "unsupported reference type" fallbacks
  • update batch planning tests to assert the closed reference cases directly

Verification

  • dotnet test PlateauResoniteLink.sln --configuration Release --no-restore --verbosity normal --filter "FullyQualifiedName~ResoniteSceneBatchEmissionPlanningTests" -m:1 --disable-build-servers -p:UseSharedCompilation=false
  • dotnet restore PlateauResoniteLink.sln --locked-mode --disable-build-servers
  • dotnet format whitespace . --folder --verify-no-changes
  • dotnet build PlateauResoniteLink.sln --configuration Release --no-restore --disable-build-servers -m:1 -p:UseSharedCompilation=false
  • dotnet test PlateauResoniteLink.sln --configuration Release --no-restore --verbosity normal -m:1 --disable-build-servers -p:UseSharedCompilation=false
  • dotnet run --project src/PlateauResoniteLink.Cli/PlateauResoniteLink.Cli.csproj --configuration Release --no-build -- import --dataset plateau-13213-higashimurayama-shi-2020 --mesh-code 53395325 --packages dem,bldg --citygml-source "C:\Users\esnya\Documents\PLATEAU-ResoniteLink\runtime\windows\resonite\plateau-13213-higashimurayama-shi-2020\source-archive-5039b16c4b1c.zip" --geotiff-source "C:\Users\esnya\Documents\PLATEAU-ResoniteLink\runtime\windows\resonite\plateau-13213-higashimurayama-shi-2020\source-ortho-cc68652cc45c.7z" --terrain-mesh grid --work-root "C:\Users\esnya\Documents\PLATEAU-ResoniteLink\runtime\windows\resonite" --canonical-scene-dump "C:\Users\esnya\Documents\PLATEAU-ResoniteLink\runtime\windows\resonite\semantic-baselines\type-planned-world-references\current\higashi-53395325-dem-bldg-grid-geotiff.json"
  • git diff --no-index -- "C:\Users\esnya\Documents\PLATEAU-ResoniteLink\runtime\windows\resonite\semantic-baselines\type-dem-grid-projection-result\baseline-parent\higashi-53395325-dem-bldg-grid-geotiff.json" "C:\Users\esnya\Documents\PLATEAU-ResoniteLink\runtime\windows\resonite\semantic-baselines\type-planned-world-references\current\higashi-53395325-dem-bldg-grid-geotiff.json"

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors “planned” slot/world element references used by the Resonite batch planner/interpreter from nullable multi-field containers into closed discriminated cases, and updates tests to assert those cases directly. This improves type-safety by removing downstream “unsupported reference type” fallbacks and centralizing resolution via case-owned Match methods.

Changes:

  • Replace PlannedSlotTargetReference / PlannedWorldElementReference nullable multi-field representations with closed nested-case records and Match(...) dispatch.
  • Route slot/world element ID resolution through the new Match(...) APIs in the batch emission interpreter.
  • Update batch planning tests to assert the concrete reference cases rather than nullable fields.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/PlateauResoniteLink.Tests/Targets/ResoniteSceneBatchEmissionPlanningTests.cs Updates assertions/helpers to validate the new closed reference cases (and uses Match for ID resolution in test helpers).
src/PlateauResoniteLink/Targets/Resonite/ResoniteSceneEmissionPlan.cs Implements the new closed-case reference types with Match-based dispatch.
src/PlateauResoniteLink/Targets/Resonite/Execution/ResonitePlannedBatchEmissionInterpreter.cs Updates runtime resolution of planned/canonical references to use Match instead of nullable-field probing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Owner Author

esnya commented Jun 1, 2026

このままだと Close / 作り直し寄りです。Match で下流 resolution をきれいにするより、planning 境界で unresolved / unsupported world reference を作れないようにしてください。

planned world reference は実行可能な参照だけを表す形ならマージ可能です。非対応は variant ではなく diagnostic / skip / failure に閉じてください。

Base automatically changed from codex/type-nondem-triangle-bake-inputs to codex/type-nondem-rendered-atlas June 1, 2026 18:00
@esnya esnya force-pushed the codex/type-nondem-rendered-atlas branch from f303f33 to 5918c84 Compare June 1, 2026 18:48
@esnya esnya force-pushed the codex/type-planned-world-references branch from e57bb75 to 518443e Compare June 1, 2026 18:52
@esnya
Copy link
Copy Markdown
Owner Author

esnya commented Jun 1, 2026

レビュー対応しました。PlannedSlotTargetReference / PlannedWorldElementReference から Unspecified を持つ value union をやめ、実行可能な concrete case だけを作れる型に戻しました。加えて PlannedBatchEmission.Create で planned slot/component の参照先と順序を検証し、未発行 planned reference は interpreter ではなく planning 境界で失敗するようにしています。\n\nこの変更で、下流の batch interpreter は default/unsupported variant を受ける前提ではなく、validated plan の executable reference を解決するだけになります。\n\n検証:\n- dotnet restore PlateauResoniteLink.sln --locked-mode --disable-build-servers\n- dotnet format whitespace . --folder --verify-no-changes\n- dotnet build PlateauResoniteLink.sln --configuration Release --no-restore --disable-build-servers -m:1 -p:UseSharedCompilation=false\n- dotnet test PlateauResoniteLink.sln --configuration Release --no-restore --verbosity normal -m:1 --disable-build-servers -p:UseSharedCompilation=false\n- Fake Live Sink canonical dump for plateau-13213-higashimurayama-shi-2020 / 53395325 / dem,bldg / grid matched the existing semantic baseline with git diff --no-index.

@esnya
Copy link
Copy Markdown
Owner Author

esnya commented Jun 2, 2026

追加レビュー対応です。前回の対応で Unspecified は消えていましたが、interpreter/test helper 側に closed union を受けた後の _ => throw / unsupported fallback がまだ残っていたため、planning contract側へ寄せました。

  • PlannedSlotTargetReference / PlannedWorldElementReference / PlannedMember に case-owned Match を追加し、batch interpreter から planned reference/member の default unsupported 分岐を削除
  • PlannedDriverTargetBundle.Create を Field_bool / Field_float overload にして、driver default value の unsupported runtime check を削除
  • PlannedAddressableFieldMember を Int2 / Bool / Float の実行可能caseに閉じ、広い Member を受けて interpreter で弾く経路を削除
  • テストも抽象基底ではなく concrete addressable field case を assert するよう更新

検証:

  • dotnet restore PlateauResoniteLink.sln --locked-mode --disable-build-servers
  • dotnet format whitespace . --folder --verify-no-changes
  • dotnet build PlateauResoniteLink.sln --configuration Release --no-restore --disable-build-servers -m:1 -p:UseSharedCompilation=false
  • dotnet test PlateauResoniteLink.sln --configuration Release --no-restore --verbosity normal -m:1 --disable-build-servers -p:UseSharedCompilation=false (996 passed)
  • Fake Live Sink canonical dump matched the existing higashi-53395325-dem-bldg-grid-geotiff.json semantic baseline via git diff --no-index; temporary dump removed.

Base automatically changed from codex/type-nondem-rendered-atlas to codex/type-scene-import-resolution-plan June 2, 2026 05:43
@esnya esnya force-pushed the codex/type-scene-import-resolution-plan branch from 6fb77b6 to 1f7cb0c Compare June 2, 2026 14:09
@esnya esnya force-pushed the codex/type-planned-world-references branch from 785e4cc to c1c1a03 Compare June 2, 2026 14:26
@esnya esnya force-pushed the codex/type-scene-import-resolution-plan branch from 1f7cb0c to c4fd4b2 Compare June 2, 2026 18:24
@esnya esnya force-pushed the codex/type-planned-world-references branch from c1c1a03 to 1e65faa Compare June 2, 2026 18:24
@esnya
Copy link
Copy Markdown
Owner Author

esnya commented Jun 2, 2026

restack で live-send run contract の construction-time validation をこの PR に移しました。planned emission reference の closure と同じ Resonite target-side execution contract の整理として扱います。\n\n検証は最上位 #356 の同一 tree 上で restore / format whitespace verify / Release build / Release test (1038 passed) まで通しています。

@esnya esnya changed the title Type planned world references Type Resonite execution contracts Jun 2, 2026
@esnya
Copy link
Copy Markdown
Owner Author

esnya commented Jun 2, 2026

Superseded by #326: the Resonite execution contract changes require the scene import plan source-resolution boundary, so they have been folded into the same main-target PR instead of keeping a dependent stack.

@esnya esnya force-pushed the codex/type-scene-import-resolution-plan branch from c4fd4b2 to 54a4c78 Compare June 2, 2026 22:26
@esnya esnya closed this Jun 2, 2026
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.

2 participants