Post

GSoC 2025 @ The Rust Foundation

GSoC 2025 @ The Rust Foundation

Welcome to my GSoC 2025 journey with the Rust Foundation. This page serves as the central hub to track my progress throughout the program.

About the Project

Project: ABI/Layout handling for the automatic differentiation feature

Overview

Over the last year, support for automatic differentiation (“autodiff”) has been added to the Rust compiler using Enzyme, an LLVM-IR based tool. However, two main layout-related issues limit its effectiveness:

Rust’s compiler performs ABI optimizations that improve performance but hinder Enzyme’s autodiff. For example, a function like fn foo(a: f32, b: f32) -> f32 might be optimized to fn foo(x: i64) -> f32 internally. While valid at the LLVM level, this transformation complicates differentiation. Functions tagged with #[rustc_autodiff] should avoid these ABI optimizations to ensure correct autodiff behavior without disabling optimizations globally.

Expected Outcome

  • Prevent ABI optimizations on functions marked with #[rustc_autodiff].
  • Enable the #[autodiff(..)] attribute to work correctly on functions with most common and complex headers.
  • Maintain performance for functions without the #[rustc_autodiff] attribute.
  • Add robust test cases to the Rust compiler test suite.
  • Fix frontend parsing bugs if they arise during testing.

Pre-Selection Period

Before official coding started, I worked on foundational tasks and smaller improvements to get familiar with compiler internals and the autodiff feature.


Community Bonding Period

During the Community Bonding Period, I engage with mentors and contributors, refine the project scope, review the codebase, and analyze optimizations related to the #[autodiff] attribute.


Coding Period

todo!()


Final Reflections and Outcomes

todo!()

This post is licensed under CC BY 4.0 by the author.