[XL] Change in dart/sdk[main]: Fine. Compute and persist LibraryManifest.hashForRequirements

0 views
Skip to first unread message

Johnni Winther (Gerrit)

unread,
Sep 26, 2025, 4:15:59 AM (3 days ago) Sep 26
to Konstantin Shcheglov, Paul Berry, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Konstantin Shcheglov and Paul Berry

Johnni Winther voted and added 1 comment

Votes added by Johnni Winther

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Johnni Winther . resolved

The hash is computed but not used yet, right?

Open in Gerrit

Related details

Attention is currently required from:
  • Konstantin Shcheglov
  • Paul Berry
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: If00778bac077e2bd36a480ca0475ad356bc1d822
Gerrit-Change-Number: 451663
Gerrit-PatchSet: 3
Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Paul Berry <paul...@google.com>
Gerrit-Attention: Paul Berry <paul...@google.com>
Gerrit-Attention: Konstantin Shcheglov <sche...@google.com>
Gerrit-Comment-Date: Fri, 26 Sep 2025 08:15:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Konstantin Shcheglov (Gerrit)

unread,
Sep 26, 2025, 11:49:55 AM (3 days ago) Sep 26
to Johnni Winther, Paul Berry, Commit Queue, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Paul Berry

Konstantin Shcheglov voted and added 1 comment

Votes added by Konstantin Shcheglov

Commit-Queue+2

1 comment

Patchset-level comments
Johnni Winther . resolved

The hash is computed but not used yet, right?

Konstantin Shcheglov

Yes.

Open in Gerrit

Related details

Attention is currently required from:
  • Paul Berry
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: If00778bac077e2bd36a480ca0475ad356bc1d822
Gerrit-Change-Number: 451663
Gerrit-PatchSet: 3
Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-Reviewer: Konstantin Shcheglov <sche...@google.com>
Gerrit-Reviewer: Paul Berry <paul...@google.com>
Gerrit-Attention: Paul Berry <paul...@google.com>
Gerrit-Comment-Date: Fri, 26 Sep 2025 15:49:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Johnni Winther <johnni...@google.com>
satisfied_requirement
open
diffy

Commit Queue (Gerrit)

unread,
Sep 26, 2025, 11:55:06 AM (3 days ago) Sep 26
to Konstantin Shcheglov, Johnni Winther, Paul Berry, dart-analys...@google.com, rev...@dartlang.org

Commit Queue submitted the change

Change information

Commit message:
Fine. Compute and persist LibraryManifest.hashForRequirements

Introduce a stable, order-independent hash derived from exactly the
parts of a library manifest that the requirements checker reads. This
hash is stored on each `LibraryManifest` (`hashForRequirements`) and
serialized as part of the binary format. When unchanged, it serves as a
fast path to skip the detailed `RequirementsManifest.isSatisfied` walk;
when it differs, the full check is re-run.

Key details:
- Hash content covers:
- Library identity and flags (name, `isSynthetic`, `featureSet`),
language versions (package/override), and `libraryMetadata.id`.
- Export surface (sorted `exportedLibraryUris`, re-export
`deprecatedOnly` names).
- All declared top-level items; for instance/Interface items also hash
members, inherited constructors, `hasNonFinalField`, and the
interface id.
- Export map id and entries, and exported extension ids.
- Determinism is ensured by sorting map entries by `LookupName` and
lists before hashing.
- New helpers on `ApiSignature` (`addList`, `addMapEntryList`) simplify
writing length-prefixed sequences.
- The manifest printer now shows the requirements hash as a compact
`#H*` identifier to aid debugging.
- Binary format change bumps `AnalysisDriver.DATA_VERSION` to 563.

This change provides a cheap, deterministic indicator for whether a
library’s manifest remains equivalent for requirements checking,
reducing unnecessary revalidation while preserving correctness.
Change-Id: If00778bac077e2bd36a480ca0475ad356bc1d822
Reviewed-by: Johnni Winther <johnni...@google.com>
Commit-Queue: Konstantin Shcheglov <sche...@google.com>
Files:
  • M pkg/analyzer/lib/src/dart/analysis/driver.dart
  • M pkg/analyzer/lib/src/fine/library_manifest.dart
  • M pkg/analyzer/lib/src/summary/api_signature.dart
  • M pkg/analyzer/test/src/dart/analysis/driver_test.dart
  • M pkg/analyzer/test/src/dart/analysis/result_printer.dart
Change size: XL
Delta: 5 files changed, 2576 insertions(+), 1 deletion(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Johnni Winther
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: If00778bac077e2bd36a480ca0475ad356bc1d822
Gerrit-Change-Number: 451663
Gerrit-PatchSet: 4
Gerrit-Owner: Konstantin Shcheglov <sche...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages