Skip to content

Comments

Fix false positive bad-instantiation for dataclass implementing protocol with __dataclass_fields__#2492

Closed
fangyi-zhou wants to merge 2 commits intofacebook:mainfrom
fangyi-zhou:fix/dataclass-protocol-abstract-dataclass-fields
Closed

Fix false positive bad-instantiation for dataclass implementing protocol with __dataclass_fields__#2492
fangyi-zhou wants to merge 2 commits intofacebook:mainfrom
fangyi-zhou:fix/dataclass-protocol-abstract-dataclass-fields

Conversation

@fangyi-zhou
Copy link
Contributor

@fangyi-zhou fangyi-zhou commented Feb 22, 2026

Summary

  • Fixes a false positive bad-instantiation error when a @dataclass implements a Protocol that declares __dataclass_fields__: ClassVar[dict[str, Field[Any]]]
  • This regression was introduced by [conformance] Handle protocol subtyping checks with instances & objects #2428, which synthesized __dataclass_fields__ as a ClassVar for dataclasses
  • Root cause: calculate_abstract_members used get_non_synthesized_class_member_and_defining_class to look up fields, which skips synthesized fields. The dataclass's synthesized __dataclass_fields__ was invisible, so the MRO traversal found the protocol's uninitialized ClassVar instead — flagging it as abstract
  • Fix: before the existing check, use get_class_member (which includes synthesized fields) to detect concrete implementations. If the class already has a non-abstract, non-uninitialized implementation, the requirement is satisfied and we skip it

Fixes #2477

Test plan

  • Added regression test test_dataclass_protocol_dataclass_fields in pyrefly/lib/test/dataclasses.rs
  • test.py

🤖 Generated with Claude Code

fangyi-zhou and others added 2 commits February 22, 2026 18:25
… protocol

When a dataclass implements a protocol that declares `__dataclass_fields__` as
a ClassVar, pyrefly incorrectly reports a bad-instantiation error because the
synthesized `__dataclass_fields__` field is not visible to the abstract member
check. Mark this as a known bug.

Fixes: facebook#2477

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…col with __dataclass_fields__

When a @DataClass implements a Protocol that declares `__dataclass_fields__` as
a ClassVar, pyrefly incorrectly reported a bad-instantiation error. The root
cause was in `calculate_abstract_members`: it used
`get_non_synthesized_class_member_and_defining_class` to look up fields, which
skips synthesized fields. This meant the synthesized `__dataclass_fields__` from
@DataClass was invisible, and the MRO traversal found the protocol's uninitialized
ClassVar declaration instead — marking the field as abstract.

Fix: Before the existing non-synthesized check, use `get_class_member` (which
includes synthesized fields) to see if the class already has a concrete
implementation. If it does (i.e., the field is not abstract and not an
uninitialized ClassVar), the requirement is already satisfied and we skip it.

Fixes: facebook#2477

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@meta-cla meta-cla bot added the cla signed label Feb 22, 2026
@fangyi-zhou fangyi-zhou changed the title Fix false positive bad-instantiation for dataclass implementing protocol with __dataclass_fields__ Fix false positive bad-instantiation for dataclass implementing protocol with __dataclass_fields__ Feb 22, 2026
@fangyi-zhou
Copy link
Contributor Author

I used Claude code to fix the regression and the fix looks reasonable.

@fangyi-zhou fangyi-zhou marked this pull request as ready for review February 22, 2026 18:49
@github-actions
Copy link

Diff from mypy_primer, showing the effect of this PR on open source code:

jinja (https://github.com/pallets/jinja)
- ERROR tests/test_async.py:647:31-62: Cannot set item in `dict[str, ((obj: Sized, /) -> int) | ((s: Any, /) -> Markup) | ((s: Any, /) -> str) | ((env: Environment, s: str, length: int = 255, killwords: bool = False, end: str = '...', leeway: int | None = None) -> str) | ((environment: Environment, obj: Any, name: str) -> Undefined | Any) | ((environment: Environment, s: str, width: int = 79, break_long_words: bool = True, wrapstring: str | None = None, break_on_hyphens: bool = True) -> str) | ((eval_ctx: EvalContext, d: Mapping[str, Any], autospace: bool = True) -> str) | ((eval_ctx: EvalContext, s: str, old: str, new: str, count: int | None = None) -> str) | ((eval_ctx: EvalContext, value: str, trim_url_limit: int | None = None, nofollow: bool = False, target: str | None = None, rel: str | None = None, extra_schemes: Iterable[str] | None = None) -> str) | ((eval_ctx: EvalContext, value: Any, indent: int | None = None) -> Markup) | ((s: str) -> int) | ((s: str) -> str) | ((s: str, width: int | str = 4, first: bool = False, blank: bool = False) -> str) | ((value: HasHTML | str) -> Markup) | ((value: HasHTML | str) -> str) | ((value: Iterable[tuple[str, Any]] | Mapping[str, Any] | str) -> str) | ((value: float | int | str, binary: bool = False) -> str) | ((value: float, precision: int = 0, method: Literal['ceil', 'common', 'floor'] = 'common') -> float) | ((value: str) -> Markup) | ((value: str, chars: str | None = None) -> str) | ((value: str, width: int = 80) -> str) | ((value: str, *args: Any, **kwargs: Any) -> str) | ((value: Any) -> str) | ((value: Any, default: float = ...) -> float) | ((value: Any, default: int = 0, base: int = 10) -> int) | ((*args: Unknown, **kwargs: Unknown) -> Unknown) | Overload[(context: Context, value: AsyncIterable[Any] | Iterable[Any], name: str, *args: Any, **kwargs: Any) -> Iterable[Any], (context: Context, value: AsyncIterable[Any] | Iterable[Any], *, attribute: str = ..., default: Any | None = None) -> Iterable[Any]] | Overload[(value: str) -> str, [V](value: Iterable[Unknown]) -> Iterable[Unknown]] | [K, V](value: Mapping[Unknown, Unknown], case_sensitive: bool = False, by: Literal['key', 'value'] = 'key', reverse: bool = False) -> list[tuple[Unknown, Unknown]] | [K, V](value: Mapping[Unknown, Unknown] | Undefined) -> Iterator[tuple[Unknown, Unknown]] | [V](value: Iterable[Unknown], linecount: int, fill_with: Unknown | None = None) -> Iterator[list[Unknown]] | [V](value: Unknown, default_value: Unknown = ..., boolean: bool = False) -> Unknown | [V](environment: Environment, seq: Reversible[Unknown]) -> Undefined | Unknown | [V](environment: Environment, value: Iterable[Unknown], case_sensitive: bool = False, attribute: int | str | None = None) -> Undefined | Unknown | [V](context: Context, seq: Sequence[Unknown]) -> Undefined | Unknown | [V](environment: Environment, value: Iterable[Unknown], reverse: bool = False, case_sensitive: bool = False, attribute: int | str | None = None) -> list[Unknown] | [_T](x: SupportsAbs[Unknown], /) -> Unknown]` [unsupported-operation]
+ ERROR tests/test_async.py:647:31-62: Cannot set item in `dict[str, ((obj: Sized, /) -> int) | ((s: Any, /) -> Markup) | ((s: Any, /) -> str) | ((env: Environment, s: str, length: int = 255, killwords: bool = False, end: str = '...', leeway: int | None = None) -> str) | ((environment: Environment, obj: Any, name: str) -> Undefined | Any) | ((environment: Environment, s: str, width: int = 79, break_long_words: bool = True, wrapstring: str | None = None, break_on_hyphens: bool = True) -> str) | ((eval_ctx: EvalContext, d: Mapping[str, Any], autospace: bool = True) -> str) | ((eval_ctx: EvalContext, s: str, old: str, new: str, count: int | None = None) -> str) | ((eval_ctx: EvalContext, value: str, trim_url_limit: int | None = None, nofollow: bool = False, target: str | None = None, rel: str | None = None, extra_schemes: Iterable[str] | None = None) -> str) | ((eval_ctx: EvalContext, value: Any, indent: int | None = None) -> Markup) | ((s: str) -> int) | ((s: str) -> str) | ((s: str, width: int | str = 4, first: bool = False, blank: bool = False) -> str) | ((value: HasHTML | str) -> Markup) | ((value: HasHTML | str) -> str) | ((value: Iterable[tuple[str, Any]] | Mapping[str, Any] | str) -> str) | ((value: float | int | str, binary: bool = False) -> str) | ((value: float, precision: int = 0, method: Literal['ceil', 'common', 'floor'] = 'common') -> float) | ((value: str) -> Markup) | ((value: str, chars: str | None = None) -> str) | ((value: str, width: int = 80) -> str) | ((value: str, *args: Any, **kwargs: Any) -> str) | ((value: Any) -> str) | ((value: Any, default: float = ...) -> float) | ((value: Any, default: int = 0, base: int = 10) -> int) | ((*args: Unknown, **kwargs: Unknown) -> Unknown) | Overload[(context: Context, value: AsyncIterable[Any] | Iterable[Any], name: str, *args: Any, **kwargs: Any) -> Iterable[Any], (context: Context, value: AsyncIterable[Any] | Iterable[Any], *, attribute: str = ..., default: Any | None = None) -> Iterable[Any]] | Overload[(value: str) -> str, [V](value: Iterable[Unknown]) -> Iterable[Unknown]] | [K, V](value: Mapping[Unknown, Unknown] | Undefined) -> Iterator[tuple[Unknown, Unknown]] | [K, V](value: Mapping[Unknown, Unknown], case_sensitive: bool = False, by: Literal['key', 'value'] = 'key', reverse: bool = False) -> list[tuple[Unknown, Unknown]] | [V](environment: Environment, value: Iterable[Unknown], reverse: bool = False, case_sensitive: bool = False, attribute: int | str | None = None) -> list[Unknown] | [V](value: Iterable[Unknown], linecount: int, fill_with: Unknown | None = None) -> Iterator[list[Unknown]] | [V](environment: Environment, value: Iterable[Unknown], case_sensitive: bool = False, attribute: int | str | None = None) -> Undefined | Unknown | [V](value: Unknown, default_value: Unknown = ..., boolean: bool = False) -> Unknown | [V](environment: Environment, seq: Reversible[Unknown]) -> Undefined | Unknown | [V](context: Context, seq: Sequence[Unknown]) -> Undefined | Unknown | [_T](x: SupportsAbs[Unknown], /) -> Unknown]` [unsupported-operation]
- ERROR tests/test_regression.py:87:34-66: Cannot set item in `dict[str, ((obj: Sized, /) -> int) | ((s: Any, /) -> Markup) | ((s: Any, /) -> str) | ((env: Environment, s: str, length: int = 255, killwords: bool = False, end: str = '...', leeway: int | None = None) -> str) | ((environment: Environment, obj: Any, name: str) -> Undefined | Any) | ((environment: Environment, s: str, width: int = 79, break_long_words: bool = True, wrapstring: str | None = None, break_on_hyphens: bool = True) -> str) | ((eval_ctx: EvalContext, d: Mapping[str, Any], autospace: bool = True) -> str) | ((eval_ctx: EvalContext, s: str, old: str, new: str, count: int | None = None) -> str) | ((eval_ctx: EvalContext, value: str, trim_url_limit: int | None = None, nofollow: bool = False, target: str | None = None, rel: str | None = None, extra_schemes: Iterable[str] | None = None) -> str) | ((eval_ctx: EvalContext, value: Any, indent: int | None = None) -> Markup) | ((s: str) -> int) | ((s: str) -> str) | ((s: str, width: int | str = 4, first: bool = False, blank: bool = False) -> str) | ((value: HasHTML | str) -> Markup) | ((value: HasHTML | str) -> str) | ((value: Iterable[tuple[str, Any]] | Mapping[str, Any] | str) -> str) | ((value: float | int | str, binary: bool = False) -> str) | ((value: float, precision: int = 0, method: Literal['ceil', 'common', 'floor'] = 'common') -> float) | ((value: str) -> Markup) | ((value: str, chars: str | None = None) -> str) | ((value: str, width: int = 80) -> str) | ((value: str, *args: Any, **kwargs: Any) -> str) | ((value: Any) -> str) | ((value: Any, default: float = ...) -> float) | ((value: Any, default: int = 0, base: int = 10) -> int) | ((*args: Unknown, **kwargs: Unknown) -> Unknown) | Overload[(context: Context, value: AsyncIterable[Any] | Iterable[Any], name: str, *args: Any, **kwargs: Any) -> Iterable[Any], (context: Context, value: AsyncIterable[Any] | Iterable[Any], *, attribute: str = ..., default: Any | None = None) -> Iterable[Any]] | Overload[(value: str) -> str, [V](value: Iterable[Unknown]) -> Iterable[Unknown]] | [K, V](value: Mapping[Unknown, Unknown], case_sensitive: bool = False, by: Literal['key', 'value'] = 'key', reverse: bool = False) -> list[tuple[Unknown, Unknown]] | [K, V](value: Mapping[Unknown, Unknown] | Undefined) -> Iterator[tuple[Unknown, Unknown]] | [V](value: Iterable[Unknown], linecount: int, fill_with: Unknown | None = None) -> Iterator[list[Unknown]] | [V](value: Unknown, default_value: Unknown = ..., boolean: bool = False) -> Unknown | [V](environment: Environment, seq: Reversible[Unknown]) -> Undefined | Unknown | [V](environment: Environment, value: Iterable[Unknown], case_sensitive: bool = False, attribute: int | str | None = None) -> Undefined | Unknown | [V](context: Context, seq: Sequence[Unknown]) -> Undefined | Unknown | [V](environment: Environment, value: Iterable[Unknown], reverse: bool = False, case_sensitive: bool = False, attribute: int | str | None = None) -> list[Unknown] | [_T](x: SupportsAbs[Unknown], /) -> Unknown]` [unsupported-operation]
+ ERROR tests/test_regression.py:87:34-66: Cannot set item in `dict[str, ((obj: Sized, /) -> int) | ((s: Any, /) -> Markup) | ((s: Any, /) -> str) | ((env: Environment, s: str, length: int = 255, killwords: bool = False, end: str = '...', leeway: int | None = None) -> str) | ((environment: Environment, obj: Any, name: str) -> Undefined | Any) | ((environment: Environment, s: str, width: int = 79, break_long_words: bool = True, wrapstring: str | None = None, break_on_hyphens: bool = True) -> str) | ((eval_ctx: EvalContext, d: Mapping[str, Any], autospace: bool = True) -> str) | ((eval_ctx: EvalContext, s: str, old: str, new: str, count: int | None = None) -> str) | ((eval_ctx: EvalContext, value: str, trim_url_limit: int | None = None, nofollow: bool = False, target: str | None = None, rel: str | None = None, extra_schemes: Iterable[str] | None = None) -> str) | ((eval_ctx: EvalContext, value: Any, indent: int | None = None) -> Markup) | ((s: str) -> int) | ((s: str) -> str) | ((s: str, width: int | str = 4, first: bool = False, blank: bool = False) -> str) | ((value: HasHTML | str) -> Markup) | ((value: HasHTML | str) -> str) | ((value: Iterable[tuple[str, Any]] | Mapping[str, Any] | str) -> str) | ((value: float | int | str, binary: bool = False) -> str) | ((value: float, precision: int = 0, method: Literal['ceil', 'common', 'floor'] = 'common') -> float) | ((value: str) -> Markup) | ((value: str, chars: str | None = None) -> str) | ((value: str, width: int = 80) -> str) | ((value: str, *args: Any, **kwargs: Any) -> str) | ((value: Any) -> str) | ((value: Any, default: float = ...) -> float) | ((value: Any, default: int = 0, base: int = 10) -> int) | ((*args: Unknown, **kwargs: Unknown) -> Unknown) | Overload[(context: Context, value: AsyncIterable[Any] | Iterable[Any], name: str, *args: Any, **kwargs: Any) -> Iterable[Any], (context: Context, value: AsyncIterable[Any] | Iterable[Any], *, attribute: str = ..., default: Any | None = None) -> Iterable[Any]] | Overload[(value: str) -> str, [V](value: Iterable[Unknown]) -> Iterable[Unknown]] | [K, V](value: Mapping[Unknown, Unknown] | Undefined) -> Iterator[tuple[Unknown, Unknown]] | [K, V](value: Mapping[Unknown, Unknown], case_sensitive: bool = False, by: Literal['key', 'value'] = 'key', reverse: bool = False) -> list[tuple[Unknown, Unknown]] | [V](environment: Environment, value: Iterable[Unknown], reverse: bool = False, case_sensitive: bool = False, attribute: int | str | None = None) -> list[Unknown] | [V](value: Iterable[Unknown], linecount: int, fill_with: Unknown | None = None) -> Iterator[list[Unknown]] | [V](environment: Environment, value: Iterable[Unknown], case_sensitive: bool = False, attribute: int | str | None = None) -> Undefined | Unknown | [V](value: Unknown, default_value: Unknown = ..., boolean: bool = False) -> Unknown | [V](environment: Environment, seq: Reversible[Unknown]) -> Undefined | Unknown | [V](context: Context, seq: Sequence[Unknown]) -> Undefined | Unknown | [_T](x: SupportsAbs[Unknown], /) -> Unknown]` [unsupported-operation]
- ERROR tests/test_security.py:182:30-33: Cannot set item in `dict[str, ((obj: Sized, /) -> int) | ((s: Any, /) -> Markup) | ((s: Any, /) -> str) | ((env: Environment, s: str, length: int = 255, killwords: bool = False, end: str = '...', leeway: int | None = None) -> str) | ((environment: Environment, obj: Any, name: str) -> Undefined | Any) | ((environment: Environment, s: str, width: int = 79, break_long_words: bool = True, wrapstring: str | None = None, break_on_hyphens: bool = True) -> str) | ((eval_ctx: EvalContext, d: Mapping[str, Any], autospace: bool = True) -> str) | ((eval_ctx: EvalContext, s: str, old: str, new: str, count: int | None = None) -> str) | ((eval_ctx: EvalContext, value: str, trim_url_limit: int | None = None, nofollow: bool = False, target: str | None = None, rel: str | None = None, extra_schemes: Iterable[str] | None = None) -> str) | ((eval_ctx: EvalContext, value: Any, indent: int | None = None) -> Markup) | ((s: str) -> int) | ((s: str) -> str) | ((s: str, width: int | str = 4, first: bool = False, blank: bool = False) -> str) | ((value: HasHTML | str) -> Markup) | ((value: HasHTML | str) -> str) | ((value: Iterable[tuple[str, Any]] | Mapping[str, Any] | str) -> str) | ((value: float | int | str, binary: bool = False) -> str) | ((value: float, precision: int = 0, method: Literal['ceil', 'common', 'floor'] = 'common') -> float) | ((value: str) -> Markup) | ((value: str, chars: str | None = None) -> str) | ((value: str, width: int = 80) -> str) | ((value: str, *args: Any, **kwargs: Any) -> str) | ((value: Any) -> str) | ((value: Any, default: float = ...) -> float) | ((value: Any, default: int = 0, base: int = 10) -> int) | ((*args: Unknown, **kwargs: Unknown) -> Unknown) | Overload[(context: Context, value: AsyncIterable[Any] | Iterable[Any], name: str, *args: Any, **kwargs: Any) -> Iterable[Any], (context: Context, value: AsyncIterable[Any] | Iterable[Any], *, attribute: str = ..., default: Any | None = None) -> Iterable[Any]] | Overload[(value: str) -> str, [V](value: Iterable[Unknown]) -> Iterable[Unknown]] | [K, V](value: Mapping[Unknown, Unknown], case_sensitive: bool = False, by: Literal['key', 'value'] = 'key', reverse: bool = False) -> list[tuple[Unknown, Unknown]] | [K, V](value: Mapping[Unknown, Unknown] | Undefined) -> Iterator[tuple[Unknown, Unknown]] | [V](value: Iterable[Unknown], linecount: int, fill_with: Unknown | None = None) -> Iterator[list[Unknown]] | [V](value: Unknown, default_value: Unknown = ..., boolean: bool = False) -> Unknown | [V](environment: Environment, seq: Reversible[Unknown]) -> Undefined | Unknown | [V](environment: Environment, value: Iterable[Unknown], case_sensitive: bool = False, attribute: int | str | None = None) -> Undefined | Unknown | [V](context: Context, seq: Sequence[Unknown]) -> Undefined | Unknown | [V](environment: Environment, value: Iterable[Unknown], reverse: bool = False, case_sensitive: bool = False, attribute: int | str | None = None) -> list[Unknown] | [_T](x: SupportsAbs[Unknown], /) -> Unknown]` [unsupported-operation]
+ ERROR tests/test_security.py:182:30-33: Cannot set item in `dict[str, ((obj: Sized, /) -> int) | ((s: Any, /) -> Markup) | ((s: Any, /) -> str) | ((env: Environment, s: str, length: int = 255, killwords: bool = False, end: str = '...', leeway: int | None = None) -> str) | ((environment: Environment, obj: Any, name: str) -> Undefined | Any) | ((environment: Environment, s: str, width: int = 79, break_long_words: bool = True, wrapstring: str | None = None, break_on_hyphens: bool = True) -> str) | ((eval_ctx: EvalContext, d: Mapping[str, Any], autospace: bool = True) -> str) | ((eval_ctx: EvalContext, s: str, old: str, new: str, count: int | None = None) -> str) | ((eval_ctx: EvalContext, value: str, trim_url_limit: int | None = None, nofollow: bool = False, target: str | None = None, rel: str | None = None, extra_schemes: Iterable[str] | None = None) -> str) | ((eval_ctx: EvalContext, value: Any, indent: int | None = None) -> Markup) | ((s: str) -> int) | ((s: str) -> str) | ((s: str, width: int | str = 4, first: bool = False, blank: bool = False) -> str) | ((value: HasHTML | str) -> Markup) | ((value: HasHTML | str) -> str) | ((value: Iterable[tuple[str, Any]] | Mapping[str, Any] | str) -> str) | ((value: float | int | str, binary: bool = False) -> str) | ((value: float, precision: int = 0, method: Literal['ceil', 'common', 'floor'] = 'common') -> float) | ((value: str) -> Markup) | ((value: str, chars: str | None = None) -> str) | ((value: str, width: int = 80) -> str) | ((value: str, *args: Any, **kwargs: Any) -> str) | ((value: Any) -> str) | ((value: Any, default: float = ...) -> float) | ((value: Any, default: int = 0, base: int = 10) -> int) | ((*args: Unknown, **kwargs: Unknown) -> Unknown) | Overload[(context: Context, value: AsyncIterable[Any] | Iterable[Any], name: str, *args: Any, **kwargs: Any) -> Iterable[Any], (context: Context, value: AsyncIterable[Any] | Iterable[Any], *, attribute: str = ..., default: Any | None = None) -> Iterable[Any]] | Overload[(value: str) -> str, [V](value: Iterable[Unknown]) -> Iterable[Unknown]] | [K, V](value: Mapping[Unknown, Unknown] | Undefined) -> Iterator[tuple[Unknown, Unknown]] | [K, V](value: Mapping[Unknown, Unknown], case_sensitive: bool = False, by: Literal['key', 'value'] = 'key', reverse: bool = False) -> list[tuple[Unknown, Unknown]] | [V](environment: Environment, value: Iterable[Unknown], reverse: bool = False, case_sensitive: bool = False, attribute: int | str | None = None) -> list[Unknown] | [V](value: Iterable[Unknown], linecount: int, fill_with: Unknown | None = None) -> Iterator[list[Unknown]] | [V](environment: Environment, value: Iterable[Unknown], case_sensitive: bool = False, attribute: int | str | None = None) -> Undefined | Unknown | [V](value: Unknown, default_value: Unknown = ..., boolean: bool = False) -> Unknown | [V](environment: Environment, seq: Reversible[Unknown]) -> Undefined | Unknown | [V](context: Context, seq: Sequence[Unknown]) -> Undefined | Unknown | [_T](x: SupportsAbs[Unknown], /) -> Unknown]` [unsupported-operation]

jax (https://github.com/google/jax)
- ERROR jax/_src/pallas/mosaic/core.py:346:37-39: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1677:47-49: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/_src/pallas/mosaic/pallas_call_registration.py:347:44-46: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/_src/pallas/mosaic/pallas_call_registration.py:433:44-46: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/_src/pallas/mosaic/sc_core.py:206:46-48: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/_src/pallas/mosaic/sc_core.py:310:46-48: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/_src/pallas/mosaic_gpu/core.py:1359:37-39: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/_src/pallas/mosaic_gpu/pallas_call_registration.py:70:41-43: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/_src/pallas/triton/pallas_call_registration.py:78:47-49: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/attention.py:288:43-289:55: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/attention.py:351:43-70: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/attention.py:633:45-635:10: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/attention_mgpu.py:318:43-61: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/attention_mgpu.py:601:43-61: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/attention_mgpu.py:622:41-59: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/attention_mgpu.py:790:43-792:8: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/decode_attention.py:196:41-198:6: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/layer_norm.py:111:43-64: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/layer_norm.py:257:43-64: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/layer_norm.py:289:43-64: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/layer_norm.py:325:43-326:54: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/paged_attention.py:261:43-263:8: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/ragged_dot_mgpu.py:237:43-239:8: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/rms_norm.py:88:43-64: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/rms_norm.py:224:43-64: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/rms_norm.py:256:43-64: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/rms_norm.py:292:43-294:8: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/gpu/softmax.py:83:43-84:45: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/all_gather.py:139:45-62: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/flash_attention.py:769:43-776:8: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/flash_attention.py:1132:45-1139:10: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/flash_attention.py:1467:45-1474:10: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/matmul.py:81:43-82:69: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/megablox/gmm.py:541:43-542:74: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/megablox/gmm.py:780:43-781:74: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/paged_attention/paged_attention_kernel.py:651:43-653:8: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/ragged_paged_attention/kernel.py:888:43-894:8: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1158:45-1160:10: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:1644:45-1646:10: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]
- ERROR jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2210:45-2212:10: Cannot instantiate `CompilerParams` because the following members are abstract: `__dataclass_fields__` [bad-instantiation]

@yangdanny97 yangdanny97 self-assigned this Feb 23, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 23, 2026

@yangdanny97 has imported this pull request. If you are a Meta employee, you can view this in D94091926.

Copy link
Contributor

@kinto0 kinto0 left a comment

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

Copy link
Contributor

@grievejia grievejia left a comment

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@meta-codesync
Copy link

meta-codesync bot commented Feb 23, 2026

@yangdanny97 merged this pull request in efba20b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive bad-instantiation due to abstract __dataclass_fields__

5 participants