ParameterKeys: split FindByName (lookup only) and GetOrCreate
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with ParameterKeys.cs, the three ParameterKeySerializer.cs serializers, and Effect.cs methods FindOrCreateResourceKey and FindOrCreateValueKey; trace how key types and registration work. Update those callers to use the proposed lookup and get-or-create behavior, then check the related tests for matching types, missing names, type mismatches, and concurrent creation. Done means lookup has no side effects and key creation is registered atomically under one lock.
索引モデルが issue の本文から書いたものです。
説明
Today ParameterKeys.FindByName is used both to look up a key and, by the callers, to create a key when the name is unknown. Each caller does it its own way.
- The three key serializers (
ParameterKeySerializer.cs) callFindByName, then create a key andMergeit if the name was not found. The lookup and theMergetake the lock separately, so two threads can create two keys for the same name. Effect.cs(FindOrCreateResourceKey,FindOrCreateValueKey) creates a key for an unknown name but never registers it.FindByNameitself has a side effect: for a name likeX.Y.Zit creates and registers a subkey ofX.Y.
Unknown names are normal here. A key's identity is its name (Equals compares Name), and shaders can have variables with no C# key. So creating the key is the right behavior. A key that exists with a different type is the real error.
Proposal:
FindByNamereturnsParameterKey?and only looks up.- Add
GetOrCreate…<T>(name, length)for value, object and permutation keys. Under one lock, it returns the existing key if the type matches, creates and registers it if the name is missing, and throws if the type is different. - The serializers and
Effect.csuse it.
Came up in #3584.
- 主要言語
- C#
- スター
- 8k
- フォーク
- 1.2k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 321
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stride3d/stride のほかの issue
-
area-Build bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
area-Samples enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stride3d/stride#3386 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
area-Physics bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
stride3d/stride#3384 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area-Samples bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
stride3d/stride#3066 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
[Docs] Update Entity.cs XML Comments再び着手できるかも @andyp53 が 130 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンarea-Doc
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
stride3d/stride#2452 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
stride3d/stride の issue をすべて見る
似ている issue
-
bug priority:low severity:S3
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
squid-farm/talewright#909 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/Agents-for-net#1108 ·
メンテナーはふだん 1 日以内に返信
-
kronos:develop:queued priority:P0
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100