Skip to content

[META][AutoDiff] Tech debt from tests #77773

Open
@kovdan01

Description

@kovdan01

Description

I've assigned preliminary priorities for the issues, but this should be revisited.

High priority:

Medium priority:

Low priority:

  • [AutoDiff][test] Investigate if a BooleanLiteralFolding-related crash was fixed #77762
    Notes:

    1. TODO: cannot use literal true because it crashes
    2. TODO: cannot use literal false because it crashes

    Tests:

    1. test/AutoDiff/compiler_crashers_fixed/58660-conflicting-debug-info-inlining.swift
    2. test/AutoDiff/compiler_crashers_fixed/issue-58123-mutating-functions-with-control-flow.swift
    3. test/AutoDiff/validation-test/address_only_tangentvector.swift
    4. test/AutoDiff/validation-test/control_flow.swift
  • [AutoDiff][test] Ensure if @differentiable function SILGen thunking is fixed #77775
    Note: TODO(TF-851): Uncomment the tests below after @differentiable function SILGen thunking is fixed.
    Test: test/AutoDiff/SILOptimizer/generics.swift

  • Note: TODO: Re-enable the boolean-literal-folding pass and fix the test accordingly
    Test: test/AutoDiff/SILOptimizer/activity_analysis.swift

  • Note: TODO(TF-956): Improve location of active enum non-differentiability errors
    Test: test/AutoDiff/SILOptimizer/differentiation_control_flow_diagnostics.swift

  • Note: TODO(TF-957): Improve non-differentiability errors for for-in loops
    Test: test/AutoDiff/SILOptimizer/differentiation_control_flow_diagnostics.swift

  • Note: TODO(TF-788): Re-enable non-varied result warning.
    Test: test/AutoDiff/SILOptimizer/differentiation_diagnostics.swift

  • Note: TODO(TF-482): Remove diagnostics when @differentiable attributes are also uniqued based on generic requirements.
    Test: test/AutoDiff/Sema/differentiable_attr_type_checking.swift

  • Note: TODO(TF-650): It would be nice to diagnose protocol default implementation with missing @differentiable attribute.
    Test: test/AutoDiff/Sema/differentiable_attr_type_checking.swift

  • Note: TODO(TF-632): Fix "'TangentVector' is not a member type of 'Self'" diagnostic. The underlying error should appear instead: "covariant 'Self' can only appear at the top level of method result type".
    Test: test/AutoDiff/Sema/differentiable_attr_type_checking.swift

  • Note: FIXME: Enable test for all platforms after debugging ([SR-12741] TEST 'Swift(iphonesimulator-i386) :: AutoDiff/validation-test/control_flow.swift #55186).
    Test: test/AutoDiff/validation-test/control_flow.swift

  • Note: TODO(TF-1065): Consider disallowing qualified operators / operator names
    Tests:

    1. test/AutoDiff/Parse/transpose_attr_parse.swift
    2. test/AutoDiff/Sema/transpose_attr_type_checking.swift

Existing issues which require discussion about priorities, semantics, etc:

Class-related:

  1. [META][AutoDiff] Fix autodiff for classes and class-valued arguments #65012 and its sub-issues.
  2. [SR-12148] Make differentiation work with class types #52130 and its sub-issues.

Forward-mode-related:

  1. [SR-13464] Missing support for classes in forward-mode AD #55906
  2. [SR-13210] Forward mode differentiation SIL verification crash #55650
  3. [SR-13250] AutoDiff test failure: test/AutoDiff/validation-test/differentiable_protocol_requirements.swift #55690
    Note: FIXME: Disabled due to test failure with -O
    Test: test/AutoDiff/validation-test/differentiable_protocol_requirements.swift

Entire tests which require discussion whether we want to address tech debt for them:

Class-related:

  1. test/AutoDiff/SILGen/vtable.swift
  2. test/AutoDiff/Sema/DerivedConformances/class_differentiable.swift
  3. test/AutoDiff/validation-test/class_differentiation.swift

Forward-mode-related:

  1. test/AutoDiff/SILOptimizer/forward_mode_diagnostics.swift
  2. test/AutoDiff/validation-test/forward_mode_simd.swift
  3. test/AutoDiff/validation-test/forward_mode_simple.swift

Marked as TODO/FIXME/etc but require discussion whether we want to address them:

Class-related:

  1. Note: FIXME(rdar://74380324)
    Test: test/AutoDiff/TBD/derivative_symbols.swift
    FIXMEs are related to initializer and other special functions differentiation support
  2. Note: FIXME(TF-1080): Fix incorrect class property modify accessor derivative values.
    Test: test/AutoDiff/validation-test/inout_parameters.swift
  3. Note: TODO(TF-649): Enable @derivative to override derivatives for original declaration defined in superclass.
    Test: test/AutoDiff/Sema/derivative_attr_type_checking.swift
  4. Note: FIXME: Enable derivative registration for class property/subscript setters ([SR-13096] Fix autodiff typing rules for class-typed function parameters #55542).
    Test: test/AutoDiff/Sema/derivative_attr_type_checking.swift
    This looks working for structs.
  5. Note: FIXME(rdar://74380324)
    Test: test/AutoDiff/TBD/derivative_symbols.swift
    The FIXME is related to the following crash:
    1.      Swift version 6.1-dev (LLVM 0f86f354a7bc883, Swift e6b4e0f9f171a51)
    2.      Compiling with effective version 4.1.50
    3.      While evaluating request ASTLoweringRequest(Lowering AST to SIL for module test)
    6.      While verifying SIL function "@$s4test5ClassCyACSfcfCTJVfSUpSr".test/AutoDiff/TBD/derivative_symbols.swift
    
  6. Note: FIXME(TF-1175): Class operands should always be marked active.
    Test: test/AutoDiff/validation-test/property_wrappers.swift
  7. Note: FIXME(TF-1176): Some values are incorrectly not marked as active: %16, etc.
    Test: test/AutoDiff/SILOptimizer/activity_analysis.swift
    This is related to class property modify accessor.

Forward-mode-related:

  1. Note: TODO(TF-1254): Support forward-mode differentiation and test generated differentials.
    Test: test/AutoDiff/SILOptimizer/semantic_member_accessors_sil.swift
  2. Note: TODO(TF-1173): Move floating-point mutating operation tests to test/AutoDiff/stdlib/floating_point.swift.gyb when forward-mode differentiation supports inout parameter differentiation.
    Test: test/AutoDiff/validation-test/inout_parameters.swift
  3. Note: TODO(TF-1254): Support and test forward-mode differentiation.
    Test: test/AutoDiff/validation-test/property_wrappers.swift
  4. Note: FIXME(TF-1033): Fix forward-mode ownership error for tuple with non-active
    Test: test/AutoDiff/validation-test/simple_math.swift

Linear functions related:

  1. Note: TODO(TF-900, TF-902): Uncomment the following line to test loading a linear function from memory and direct calls to a linear function.
    Test: test/AutoDiff/SILGen/differentiable_function.swift
  2. Note: TODO: Add tests for @differentiable(_linear) functions.
    Test: test/AutoDiff/IRGen/loadable_by_address.swift

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions