YouTube2Text

All Code Is Slop (Except Mine) — Lauren Tan, SpaceXSI — Transcript

by AI Engineer · 2,848 words · 470 segments · language en · Watch on YouTube

Full transcript

  1. 0:01[music]
  2. 0:12>> All right. Um so again I'm my name is
  3. 0:16Potato. Uh I work on Grokbot at SpaceX
  4. 0:20SI.
  5. 0:21And can I just get a quick show of
  6. 0:22hands? How many of you have ever looked
  7. 0:25at code that somebody else wrote and you
  8. 0:27thought that's all slop.
  9. 0:31Well,
  10. 0:32I have too.
  11. 0:35But today I'm going to convince you that
  12. 0:36you can turn that slop into gold.
  13. 0:42Uh and so I did something crazy last
  14. 0:44month and I shipped 3,000 pull requests
  15. 0:47to production.
  16. 0:48Now before agents we never really cared
  17. 0:50about volume uh except for the outliers.
  18. 0:54And at my previous company we called
  19. 0:56these people coding machines. People
  20. 0:58like Brett Taylor who famously rewrote
  21. 1:00all of Google Maps uh in a weekend.
  22. 1:03Just an insanely productive engineer.
  23. 1:06Uh and well with agents anyone can now
  24. 1:08be a coding machine. And my thesis is
  25. 1:10that the job of the software engineer,
  26. 1:13the meta of being a software engineer is
  27. 1:15figuring out how to maintain or even
  28. 1:17improve the quality of your code while
  29. 1:20massively increasing your productivity.
  30. 1:23To get there some people like to call
  31. 1:25this a software factory. Uh but I like
  32. 1:27to keep it simple and I think of it as
  33. 1:30all about trust.
  34. 1:32Not blind trust but investing in your
  35. 1:35agents environment so you can trust that
  36. 1:37your agents are going to do the right
  37. 1:39thing.
  38. 1:40Now it takes quite a lot of effort to
  39. 1:43get there um and it took me six months
  40. 1:45to get to a point where I could ship
  41. 1:48thousands of pull requests, a lot of
  42. 1:49them in my sleep.
  43. 1:51But it's certainly possible and it will
  44. 1:53take you much less time than I did.
  45. 1:56So let's start by talking about how we
  46. 1:58move from a low trust
  47. 1:59to a high-trust one.
  48. 2:03So, this inverse pyramid is how I think
  49. 2:05about where to spend time on your
  50. 2:07agent's environment.
  51. 2:09The first two layers are deterministic,
  52. 2:12so using your code itself. So, things
  53. 2:14like good API design, architecture,
  54. 2:17refactoring, or using lint rules, type
  55. 2:20systems, compilers, or you know,
  56. 2:22different kinds of testing.
  57. 2:24And you can use both of these layers
  58. 2:26together to constrain what agents can do
  59. 2:28and force them to do the right thing by
  60. 2:30default.
  61. 2:32Verification, both runtime and formal,
  62. 2:35are great tools to layer on to find bugs
  63. 2:38and check properties and the invariance
  64. 2:40in your system that you want to hold
  65. 2:41true
  66. 2:42and also help you check whether or not
  67. 2:44the agent understood your goals and your
  68. 2:46intent.
  69. 2:48And then finally, you want to layer with
  70. 2:50a little bit of prose. So, things like
  71. 2:52rules, skills, agents.md, things that
  72. 2:56require judgment.
  73. 2:59But let's start with your codebase.
  74. 3:01Agents generate their outputs based on
  75. 3:03their inputs. And so the the quality of
  76. 3:06the input really matters, and it just so
  77. 3:07happens that your codebase is one of the
  78. 3:10largest inputs.
  79. 3:12So, whenever you're correcting your
  80. 3:13agent, think about how you can make that
  81. 3:15a deterministic check instead of adding
  82. 3:18another line to your rules or your
  83. 3:20agents.md because it's far more
  84. 3:22reproducible when it's in code and it
  85. 3:24lets you trust it more.
  86. 3:27And the analogy that I like to use is
  87. 3:29that your codebase is kind of like a
  88. 3:31garden.
  89. 3:32You know, code used to arrive a few pull
  90. 3:34requests at a time.
  91. 3:36And uh I remember going into work in
  92. 3:382024 and reviewing the three pull
  93. 3:41requests that my colleagues wrote
  94. 3:42colleagues wrote.
  95. 3:44And today, that number is more like 300.
  96. 3:47So, you know, every engineer is now a
  97. 3:49team of hundreds or even thousands of
  98. 3:52agents, and code is arriving so rapidly
  99. 3:55that it almost feels like a continuous
  100. 3:58stream, and it almost feels organic,
  101. 4:01like a living thing.
  102. 4:03And in this analogy, your codebase, the
  103. 4:06constraints that you impose, the
  104. 4:08guardrails that you put up are the
  105. 4:10concrete foundations that the new code
  106. 4:12that your agents write grow around, just
  107. 4:15like uh the building in this picture.
  108. 4:18And so in many ways, the job of being a
  109. 4:19software engineer is kind of becoming
  110. 4:21like gardening.
  111. 4:24Because code is the biggest input for
  112. 4:26agents, it means that any workarounds,
  113. 4:29um anti-patterns, deprecated code, tech
  114. 4:32debt, it's now likely to be just copied
  115. 4:35by the next agent since it looks like
  116. 4:37the established pattern in your
  117. 4:38codebase.
  118. 4:39And uh it's like you have some weeds or
  119. 4:43pests growing in your garden, and then
  120. 4:45they spread everywhere before you know
  121. 4:47it.
  122. 4:51So you want to make your codebase as
  123. 4:53pristine as possible so that agents are
  124. 4:55always copying the good stuff.
  125. 4:58All right, let's look at some real
  126. 4:59examples.
  127. 5:00Uh so Dune is a client framework that we
  128. 5:02created for Graph Bot to implement this
  129. 5:05idea for organic architecture.
  130. 5:08It's not really that interesting
  131. 5:09technically. Uh you can kind of think of
  132. 5:11Dune as um kind of like Next.js for
  133. 5:14Electron apps.
  134. 5:15But the interesting part of Dune is that
  135. 5:17it has a lot of constraints and lint
  136. 5:19rules that we've encoded uh a lot of the
  137. 5:21lessons that we've learned building
  138. 5:23desktop applications.
  139. 5:26And one such lesson is that anything
  140. 5:28that requires nuance to use well often
  141. 5:31leads to slop.
  142. 5:33Uh you know your classic example is uh
  143. 5:35you know use effect in React, right? It
  144. 5:37has its use cases, uh but it's often
  145. 5:40misused. You know some people joke that
  146. 5:42you need a PhD to use use effect.
  147. 5:45Um and in in other words, it really
  148. 5:46requires a lot of nuance to use well.
  149. 5:50And agents are not good at using it.
  150. 5:52Um so our solution has been to just ban
  151. 5:55it in product code, and it's really only
  152. 5:58allowed in some places inside of Dune
  153. 6:00APIs.
  154. 6:02And effectively, this problem has now
  155. 6:04been categorically eliminated, and we
  156. 6:06never need to catch that during code
  157. 6:08review again.
  158. 6:10Another interesting pattern that we use
  159. 6:12is context through directory structure.
  160. 6:15Uh so one anti-pattern that we saw with
  161. 6:17Cursor, which is an Electron app, is
  162. 6:19that agents would often
  163. 6:21import main thread code into the
  164. 6:23renderer thread, which would cause long
  165. 6:25tasks and jank.
  166. 6:28So in uh Gulp bot and in Dunanaps, we've
  167. 6:30made this very very conventional.
  168. 6:33Uh we have these two top-level
  169. 6:34directories literally called Electron
  170. 6:36renderer and Electron main,
  171. 6:38and imports between them are forbidden
  172. 6:41or banned by our dependency graph
  173. 6:43analyzer and some lint rules.
  174. 6:46And again, you know, these are simple
  175. 6:47lint rules to set up, but it means one
  176. 6:50less thing that we need to review and
  177. 6:52think about uh
  178. 6:53you know, during code review.
  179. 6:56And then
  180. 6:57one more surprising thing that I've seen
  181. 6:59is agents using Markdown. So things like
  182. 7:02documentation, uh code comments, rules
  183. 7:05or skills, and they use this as a place
  184. 7:08to write down their justifications for
  185. 7:10not doing the right thing. Or I don't
  186. 7:13know if you've ever seen this, but
  187. 7:14they'll over rotate on some small
  188. 7:16correction that you made, and they treat
  189. 7:17it like a hard rule that can never be
  190. 7:19broken ever again.
  191. 7:22And here's another example from Cursor.
  192. 7:25So agents really loved using imperative
  193. 7:27timers, so things like set timeout,
  194. 7:29request animation frame, request idle
  195. 7:31callback. And they were using these as
  196. 7:33quick fixes because
  197. 7:35they were really patching over an
  198. 7:37architecture clash between
  199. 7:39uh VS Code's imperative style and
  200. 7:41React's declarative style.
  201. 7:44So our choice of architecture actually
  202. 7:46made both the client and the agent
  203. 7:49performance much worse.
  204. 7:51And if you've ever done any performance
  205. 7:52work in JavaScript, you'll know that
  206. 7:54when you have tons of timers being
  207. 7:56rapidly created and destroyed, causes a
  208. 7:58lot of uh major garbage collection,
  209. 8:00which causes a lot of lag and jank.
  210. 8:03Uh but the worst part is that agents
  211. 8:05wrote a a of code comments, like you can
  212. 8:07see in red here, explaining why this
  213. 8:09quick fix was justified.
  214. 8:12And before you know it, we had timers
  215. 8:14spreading everywhere and the you know
  216. 8:16the performance of the app really
  217. 8:17suffered.
  218. 8:20Now in Grabot, uh we learned our lesson
  219. 8:22there and we decided to just ban 99% of
  220. 8:25comments
  221. 8:26uh because they go stale easily. Uh you
  222. 8:29know humans just really don't bother
  223. 8:31reading the comment slot anyway.
  224. 8:33And again it gives an agent the an
  225. 8:35escape hatch to justify not doing the
  226. 8:38right thing because it's hard.
  227. 8:41Um and the worst part about comments
  228. 8:43though is that they're not enforceable.
  229. 8:45So what seems well intentioned, you know
  230. 8:47like I'm going to tell the the next
  231. 8:49agent not to do something,
  232. 8:51never ends up actually being anything
  233. 8:52that you can trust.
  234. 8:54So
  235. 8:56in Grabot and Dune and in Dune uh we now
  236. 8:58have lint rules that give uh
  237. 9:01good and very helpful error messages
  238. 9:02telling the agent to fix the root cause,
  239. 9:05the real problem uh rather than just
  240. 9:08patch around it.
  241. 9:10And so our general principle is that
  242. 9:12every time we correct our agents, it
  243. 9:13turns into one of these deterministic
  244. 9:15checks or we think about how to
  245. 9:17categorically eliminate that problem in
  246. 9:19the code through better API design,
  247. 9:21through better architecture.
  248. 9:23And if you do this enough times, you'll
  249. 9:26find that you have just less things to
  250. 9:28look out for in code review.
  251. 9:30And at some point you'll realize there's
  252. 9:32there's nothing left to review.
  253. 9:34And you can just let agents merge their
  254. 9:36most of their own pull requests.
  255. 9:40All right. Uh moving on, verification is
  256. 9:43also a really big part of how we make
  257. 9:45our agent more autonomous and also
  258. 9:47increase our confidence and trust in
  259. 9:49their work.
  260. 9:50And our code review process has now
  261. 9:52really shrunk into looking at
  262. 9:54verification artifacts instead. So
  263. 9:56things like videos, screenshots,
  264. 9:58diagrams, formal verification.
  265. 10:02Um and the most basic example of this is
  266. 10:04runtime verification
  267. 10:06uh which is just a fancy way of saying
  268. 10:07giving your agent a way to run the code
  269. 10:09for itself and use debugging tools that,
  270. 10:12you know, human developers use as well,
  271. 10:14like the Chrome DevTools protocol.
  272. 10:16Um, in our runtime verification skills,
  273. 10:18we have this thing that we call a
  274. 10:20feature map.
  275. 10:21And that's basically kind of like a site
  276. 10:23map of all of the features that are
  277. 10:25available in your application from the
  278. 10:27user's point of view.
  279. 10:29And so with this, agents don't need to
  280. 10:30guess when you say, you know, the thingy
  281. 10:33in the left sidebar, it gives you some
  282. 10:35shared vocabulary.
  283. 10:37And we also make use of custom CLIs
  284. 10:39inside these skills so that agents can
  285. 10:42reuse the the CLI and the driver every
  286. 10:45time, which cuts down on token usage and
  287. 10:47is also testable.
  288. 10:50Um, and then recently we've also started
  289. 10:52looking at formal verification.
  290. 10:54Uh, so we now use TLA Plus to do some
  291. 10:56model checking of major user flows such
  292. 10:59as notifications across multiple devices
  293. 11:01and platforms.
  294. 11:03Uh, we use a lean as well for proving
  295. 11:04certain algorithms.
  296. 11:06Uh, for example, we have our own we
  297. 11:08wrote our own custom virtualization
  298. 11:09library and we use lean there to check
  299. 11:12that we don't have, you know, flickering
  300. 11:14or jittering problems.
  301. 11:16Um, and we're still experimenting with
  302. 11:17this approach overall. It seems very
  303. 11:19promising. Uh, we've already found quite
  304. 11:21a few bugs with formal verification.
  305. 11:25Uh, but it's certainly not a silver
  306. 11:26bullet and we're treating it as another
  307. 11:30tool, another layer in our agents'
  308. 11:33environment.
  309. 11:35Uh, and then this is a very fast video,
  310. 11:37but another thing that we just started
  311. 11:39looking at is property-based testing as
  312. 11:41well for UIs.
  313. 11:43Uh, so we use this library called
  314. 11:44Bombadil.
  315. 11:45Um, and this has also caught a few UI
  316. 11:47bugs for us already.
  317. 11:52Okay, so zooming out, I saw this tweet
  318. 11:53from Cindy and 6 months ago she she said
  319. 11:56that she was
  320. 11:57oh, she was talking about not being able
  321. 11:59to trust her agents because of subtle
  322. 12:01bugs that were getting merged.
  323. 12:05And really what was missing for her in
  324. 12:06being able to trust her agents was the
  325. 12:08verification process. And now, 6 months
  326. 12:11later, she says that 70% of her daily
  327. 12:13tokens go into verification. And I'd say
  328. 12:16that that tracks with what I see as
  329. 12:18well, that most of my token usage goes
  330. 12:20to verification.
  331. 12:22And if you really look closely at her
  332. 12:23process, none of these things here are
  333. 12:26new or novel techniques that we've never
  334. 12:28had before.
  335. 12:30These are just good software engineering
  336. 12:32tools, but ones that might have been
  337. 12:34prohibitively expensive to use before as
  338. 12:37they were hard to understand or write or
  339. 12:39maintain.
  340. 12:40But
  341. 12:41agents drastically cut this cost down.
  342. 12:43And really, we are entering a golden age
  343. 12:45of software testing and verification
  344. 12:47because agents let us test everything to
  345. 12:50a much greater degree than used to be
  346. 12:52economical.
  347. 12:55And then formal verification can also
  348. 12:56help you better reason about how your
  349. 12:58product should work and whether your
  350. 12:59agents really understand your intent and
  351. 13:01goals.
  352. 13:02Uh I made this new skill called state
  353. 13:04chart uh in my plugin P stack, potato
  354. 13:07stack, uh which helps you visualize
  355. 13:09state machines from uh
  356. 13:11from the user's point of view.
  357. 13:13Uh and it's I find this much easier to
  358. 13:14review alongside the videos and
  359. 13:16screenshots that we provide.
  360. 13:18Um and so that's been great.
  361. 13:21Sorry for the flashback.
  362. 13:22Uh okay, now let's look at what the
  363. 13:25promised land looks like. What do you
  364. 13:27get in return for all of this uh you
  365. 13:29know investment?
  366. 13:32So on the Growth Bot team, our velocity
  367. 13:34is uh taking off and rapidly increasing.
  368. 13:37And last month, our team shipped
  369. 13:40a ridiculous 11,000 pull requests to
  370. 13:43production,
  371. 13:44which is a wild number.
  372. 13:45And our pace of releasing the client has
  373. 13:48also increased. And we cut a new stable
  374. 13:50version about once a day.
  375. 13:54And then the core team is also shipping
  376. 13:55much more. And we also have uh a lot
  377. 13:58more casual or drive-by contributors who
  378. 14:01don't always have a lot of context,
  379. 14:04uh but they're also contributing. Um and
  380. 14:06in October, we had about 227 people who
  381. 14:10contributed at least one pull request.
  382. 14:15So So this velocity accelerating, you
  383. 14:16might be thinking to yourself like isn't
  384. 14:18this going to be chaos? You know, isn't
  385. 14:19this going to be a bunch of slop?
  386. 14:21But actually, the number of PRs that get
  387. 14:23reverted has actually gotten lower on a
  388. 14:25relative basis and is steady at about
  389. 14:27half a percent.
  390. 14:30But I think the really interesting thing
  391. 14:32about this shipping pace and this volume
  392. 14:34of pull requests
  393. 14:36is that the performance of Graph Bot has
  394. 14:39stayed not just stable, but has improved
  395. 14:41on multiple dimensions compared to when
  396. 14:43we launched. So startup, typing, opening
  397. 14:46new chats, switching chats, all of this
  398. 14:49has gotten faster.
  399. 14:51And keep in mind, Graph Bot is still an
  400. 14:53Electron app
  401. 14:55for now.
  402. 14:56So there is a ceiling, right? But it's
  403. 14:58already much faster than many other
  404. 15:00agent UIs out there.
  405. 15:02And for an Electron app with this high
  406. 15:05velocity and this many people
  407. 15:07contributing,
  408. 15:08I'd say that's pretty good.
  409. 15:11So before you jump into building out a
  410. 15:13software factory and you know,
  411. 15:14automating everything that you can,
  412. 15:17whenever you correct your agent, try and
  413. 15:18do it by improving your codebase first.
  414. 15:21You know, start with a lint rule to
  415. 15:22prevent new occurrences of anti-patterns
  416. 15:25and then clean up those old patterns as
  417. 15:27well.
  418. 15:28And then make sure that your
  419. 15:29verification story is really strong.
  420. 15:33A lot of this work is a prerequisite to
  421. 15:35automation anyway. And if your inner
  422. 15:37coding loop produces slop, then
  423. 15:40automating that loop just produces more
  424. 15:42slop and you need to throw more and more
  425. 15:44and more tokens at the problem, which we
  426. 15:46all know is very expensive.
  427. 15:49And once you meet these investments
  428. 15:51into, you know, code into your codebase,
  429. 15:53static analysis, runtime informal
  430. 15:55verification,
  431. 15:56you'll start to find that many things
  432. 15:58become possible with these foundations
  433. 16:01and that you can really easily build
  434. 16:02your own factory on top of these
  435. 16:04foundations.
  436. 16:07And when you're ready, Graph Bot is a
  437. 16:08great way to build that outer loop. We
  438. 16:11have tons of connectors, routines that
  439. 16:12can kick off cursor, cloud agents, and
  440. 16:15projects
  441. 16:16uh which let you orchestrate thousands
  442. 16:17of uh hundreds or even thousands of
  443. 16:19agents.
  444. 16:21And as a quick example, you know,
  445. 16:22whenever we cut a new release now,
  446. 16:24Grokbot will automatically spin up a new
  447. 16:26cursor project for us that will fuzz the
  448. 16:29entire application, the entire build,
  449. 16:31and it will find bugs uh by running the
  450. 16:33app and using it like a real user.
  451. 16:35And then it's going to open fixed PRs
  452. 16:38for each of those bugs that it finds and
  453. 16:39it's going to auto merge it as uh
  454. 16:42crazy as that sounds. And that's because
  455. 16:44our codebase is good enough that pull
  456. 16:46requests tend to just be good by default
  457. 16:49and most product code that we land no
  458. 16:51longer really requires deep human
  459. 16:53review.
  460. 16:56So
  461. 16:57when you have solid foundations and good
  462. 16:59organic architecture, you can turn slop
  463. 17:02into gold and you can ship with high
  464. 17:04quality uh
  465. 17:06high velocity without compromising on
  466. 17:08quality.
  467. 17:09My name is Potato, also known as Lauren.
  468. 17:11Thanks to you again for listening to my
  469. 17:13talk.
  470. 17:14>> [applause]

About this transcript

This page contains the full transcript of All Code Is Slop (Except Mine) — Lauren Tan, SpaceXSI by AI Engineer, generated from the public captions YouTube serves with the video. The transcript has 2,848 words across 470 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.