Skip to content

[SR-14222] [AutoDiff] Incorrect derivative for array literal with tuple_element_addr elements #54214

@dan-zheng

Description

@dan-zheng
Previous ID SR-14222
Radar None
Original Reporter @dan-zheng
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, AutoDiff
Assignee None
Priority Medium

md5: 0184cfd78c8d9dc3932d9cb75b334ce8

Issue Description:

func tupleElementGeneric<T>(_ x: T, _ y: T) -> [T] {
  var tuple = (x, y)
  return [tuple.0, tuple.1]
}
let pb = pullback(at: Float(3), 4, in: { tupleElementGeneric($0, $1) })
print(pb(.init([1, 1])))
//   Actual: (0.0, 2.0)
// Expected: (1.0, 1.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    AutoDiffSILOptimizerArea → compiler: SIL optimization passesarray literalsFeature → expressions → literals: Array literalsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfexpressionsFeature: expressionsswift 6.0unexpected behaviorBug: Unexpected behavior or incorrect output

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions