swift
Sema: Give constraints a more dignified retirement
#77152
Merged

Sema: Give constraints a more dignified retirement #77152

slavapestov
slavapestov279 days ago

When we retire a constraint, there is no guarantee that it is at the end of the list, so it is not correct to always reinsert it at the end of the list when the constraint comes out of retirement. Instead, remember the position where we removed it from, so that we can always reinsert it in the correct position. This allows us to replace some bespoke logic in CSStep.h with a call to retireConstraint().

Fixes #77008
Also fixes rdar://problem/138246764

slavapestov Sema: SolverTrail::Change::RetiredConstraint now remembers the position
58a6a646
slavapestov Sema: Retire disjunctions in trail instead of restoring in ~Disjuncti…
e0b6a96f
slavapestov Sema: Remove similar weirdness from ~ConjunctionStep
65def070
slavapestov type_checker_perf tests should require no_asan
66485081
slavapestov slavapestov requested a review from hborla hborla 279 days ago
slavapestov slavapestov requested a review from xedin xedin 279 days ago
slavapestov
slavapestov279 days ago

@swift-ci Please smoke test

slavapestov
slavapestov279 days ago

@swift-ci Please test source compatibility

xedin
xedin approved these changes on 2024-10-21
validation-test/Sema/type_checker_perf/slow/simd_scalar_multiple.swift.gyb
11// RUN: %scale-test --invert-result --begin 1 --end 5 --step 1 --select NumLeafScopes %s
22
3
// REQUIRES: no_asan
xedin279 days ago

Other tests have tools-release, I think we should add to all of these new test-cases too because I think tests are flaky in non-release configuration.

slavapestov slavapestov merged 1cbd7d31 into main 279 days ago
hjyamauchi
hjyamauchi277 days ago

Hi @slavapestov the windows rebranch CI started to fail: https://ci-external.swift.org/job/swift-rebranch-windows-toolchain/515/consoleText

Failed Tests (6):
  Swift(windows-x86_64) :: Concurrency/async_overload_filtering.swift
  Swift(windows-x86_64) :: Constraints/common_type.swift
  Swift(windows-x86_64) :: Constraints/init_literal_via_coercion.swift
  Swift(windows-x86_64) :: Constraints/one_way_solve.swift
  Swift(windows-x86_64) :: Constraints/overload_filtering.swift
  Swift(windows-x86_64) :: Constraints/result_builder_conjunction_selection.swift

Could this #77152 from https://ci-external.swift.org/job/swift-rebranch-windows-toolchain/515/changes#58a6a64647aeb270897241d6b229c1ffe17c37dd
be causing it? Sorry if I'm mistaken as I'm not familiar with the constraints :)

hjyamauchi
hjyamauchi276 days ago
hjyamauchi
hjyamauchi275 days ago

Thanks for the fix @slavapestov

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone