<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Jax on so i built a thing</title>
		<link>https://hamon.dev/tags/jax/</link>
		<description>Recent content in Jax on so i built a thing</description>
		<generator>Hugo</generator>
		<language>en</language>
		
		
		
		
			<lastBuildDate>Thu, 04 Jun 2026 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://hamon.dev/tags/jax/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>lumpyspace part 4</title>
				<link>https://hamon.dev/blog/lumpyspace4/</link>
				<pubDate>Thu, 04 Jun 2026 00:00:00 +0000</pubDate>
				<guid>https://hamon.dev/blog/lumpyspace4/</guid>
				<description>&lt;h2 id=&#34;a-confession&#34;&gt;&#xA;  A Confession&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#a-confession&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;In my &lt;a href=&#34;https://hamon.dev/blog/lumpyspace3/&#34; &gt;previous post&lt;/a&gt;, I explained that we had&#xA;implemented an Augmented Lagrangian (AL) method to strictly enforce the Weak&#xA;Energy Condition (WEC). I shared monitoring showing the WEC loss dropping to&#xA;exactly &lt;code&gt;0.000000e+00&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;However, it turns out we had fallen victim to a silent scoping bug inside the&#xA;JAX &lt;code&gt;@eqx.filter_jit&lt;/code&gt; compiler.&lt;/p&gt;&#xA;&lt;p&gt;To capture static hyperparameters (like &lt;code&gt;w_efe&lt;/code&gt;, &lt;code&gt;w_sn&lt;/code&gt;) without passing them&#xA;explicitly, we wrote our &lt;code&gt;loss_fn&lt;/code&gt; as an internal closure inside the compiled&#xA;&lt;code&gt;step&lt;/code&gt; function. This is a common JAX pattern. However, the Augmented Lagrangian&#xA;multiplier ($\lambda_{\text{WEC}}$) is a dynamic array that changes every single&#xA;optimization step.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
