<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amirhossein Ghanipour</title>
    <description>The latest articles on DEV Community by Amirhossein Ghanipour (@amirhosseinghanipour).</description>
    <link>https://dev.to/amirhosseinghanipour</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1775376%2F00a5f427-3109-41be-93e6-d7d14a8c14e0.jpg</url>
      <title>DEV Community: Amirhossein Ghanipour</title>
      <link>https://dev.to/amirhosseinghanipour</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amirhosseinghanipour"/>
    <language>en</language>
    <item>
      <title>The Filesystem Your Multi-GPU Rig Actually Needs</title>
      <dc:creator>Amirhossein Ghanipour</dc:creator>
      <pubDate>Tue, 10 Nov 2026 22:28:25 +0000</pubDate>
      <link>https://dev.to/amirhosseinghanipour/the-filesystem-your-multi-gpu-rig-actually-needs-1eg2</link>
      <guid>https://dev.to/amirhosseinghanipour/the-filesystem-your-multi-gpu-rig-actually-needs-1eg2</guid>
      <description>&lt;p&gt;You install four PCIe Gen5 NVMe drives in a multi-GPU server, bring up eight H100s, launch &lt;code&gt;torchrun&lt;/code&gt;, and notice an irritating pattern: GPU utilization fluctuates between 40% and 95%.&lt;/p&gt;

&lt;p&gt;A quick look at &lt;code&gt;nvidia-smi&lt;/code&gt; suggests that the GPUs are waiting for data. Profiling shows that CPU time is being spent not only on preprocessing, but also on filesystem activity: metadata operations, lock contention, and page-cache writeback during checkpointing.&lt;/p&gt;

&lt;p&gt;In a modern deep-learning system, the filesystem is not merely a passive storage layer. It is part of the data pipeline, and its concurrency characteristics can affect end-to-end training throughput.&lt;/p&gt;

&lt;p&gt;This article looks at two common local-storage workloads:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Parallel data ingestion:&lt;/strong&gt; dozens of PyTorch &lt;code&gt;DataLoader&lt;/code&gt; workers issue concurrent reads and metadata requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Large checkpoint writes:&lt;/strong&gt; training processes serialize model weights, optimizer states, and tensor data into files that can range from 10 GB to more than 200 GB per rank.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For these workloads, XFS is often a strong choice for local NVMe scratch storage. Its allocation-group architecture, extent-based allocation, and delayed allocation can make it scale well under concurrent access. That does not mean XFS wins every workload or that filesystem choice alone fixes an input pipeline; the data layout, access pattern, kernel, mount options, and hardware all matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  At a glance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Workload or concern&lt;/th&gt;
&lt;th&gt;Why it matters&lt;/th&gt;
&lt;th&gt;XFS characteristics&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Many concurrent readers&lt;/td&gt;
&lt;td&gt;Workers compete for metadata and I/O resources&lt;/td&gt;
&lt;td&gt;Allocation groups allow metadata work to be distributed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large sequential writes&lt;/td&gt;
&lt;td&gt;Checkpointing can interrupt training&lt;/td&gt;
&lt;td&gt;Extent-based allocation and delayed allocation help produce large contiguous allocations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Millions of tiny files&lt;/td&gt;
&lt;td&gt;Metadata operations can dominate useful I/O&lt;/td&gt;
&lt;td&gt;XFS is capable, but a sharded dataset is usually a better architectural solution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Copy-on-write workloads&lt;/td&gt;
&lt;td&gt;Shared extents can add write and metadata overhead when modified&lt;/td&gt;
&lt;td&gt;Ordinary XFS writes are in-place; reflink-shared extents use CoW&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NVMe throughput&lt;/td&gt;
&lt;td&gt;Queueing and I/O size affect achievable bandwidth&lt;/td&gt;
&lt;td&gt;XFS can scale well, but device and workload tuning still matter&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  1. The concurrency problem
&lt;/h2&gt;

&lt;p&gt;PyTorch's &lt;code&gt;torch.utils.data.DataLoader&lt;/code&gt; can run multiple worker processes using &lt;code&gt;num_workers&lt;/code&gt;. On a multi-GPU node, the total number of workers can become substantial. For example, eight training processes with 16 workers each can create 128 independent workers.&lt;/p&gt;

&lt;p&gt;Those workers may concurrently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open and close files.&lt;/li&gt;
&lt;li&gt;Read file and directory metadata.&lt;/li&gt;
&lt;li&gt;Resolve paths and look up inodes.&lt;/li&gt;
&lt;li&gt;Issue data reads.&lt;/li&gt;
&lt;li&gt;Update access times, depending on mount options.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The resulting workload is not simply a stream of large reads. It can also be a high-rate stream of small metadata operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  A simplified view of the I/O path
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PyTorch DataLoader workers
  Worker 1   Worker 2   Worker 3   ...   Worker N
      \         |         |                /
       \        |         |               /
        +-------+---------+--------------+
                        |
                        v
              Linux Virtual Filesystem
                        |
             +----------+----------+
             |                     |
             v                     v
           ext4                   XFS
     Block groups and       Allocation groups
     journal coordination   with per-AG metadata
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a conceptual diagram, not a claim that every operation is serialized by one global lock in ext4 or that XFS eliminates locking. Both filesystems use sophisticated concurrency mechanisms. The important distinction is that XFS can distribute many allocation and metadata operations across allocation groups.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Why ext4 can become a bottleneck
&lt;/h2&gt;

&lt;p&gt;ext4 is a mature filesystem. It performs very well across a wide range of workloads. Under highly concurrent metadata workloads, however, contention can arise around shared filesystem structures and journal activity.&lt;/p&gt;

&lt;p&gt;Two areas are worth understanding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Journal activity:&lt;/strong&gt; metadata updates are coordinated through JBD2 transactions. A workload that creates, renames, or updates large numbers of files can generate substantial journal traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Allocation and metadata coordination:&lt;/strong&gt; concurrent inode and block allocation can contend on shared structures, depending on the access pattern and filesystem layout.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The practical point is not that ext4 has a single global mutex. It does not. Rather, the cost of coordinating metadata operations can become visible when many processes issue small, concurrent filesystem requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. How XFS uses allocation groups
&lt;/h2&gt;

&lt;p&gt;XFS was designed for large filesystems and high-throughput workloads. One of its central design features is the &lt;strong&gt;allocation group (AG)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;An XFS filesystem is divided into allocation groups. Each AG maintains its own allocation metadata, including structures used to track free space and inodes. These structures are commonly implemented using B+ trees.&lt;/p&gt;

&lt;p&gt;An allocation group maintains, among other things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free-space information, indexed by block location and extent size.&lt;/li&gt;
&lt;li&gt;Inode allocation information.&lt;/li&gt;
&lt;li&gt;AG-local metadata and coordination structures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When multiple workers perform allocation or metadata operations, XFS can distribute work across different AGs rather than forcing all such activity through one shared allocation structure.&lt;/p&gt;

&lt;p&gt;This does not make XFS lock-free. It means its architecture provides multiple allocation domains, which can reduce contention for workloads that exercise them effectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Practical implication:&lt;/strong&gt; XFS is worth benchmarking when a node has many concurrent workers accessing a local NVMe filesystem, particularly when metadata activity is a measurable part of the bottleneck.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Checkpointing
&lt;/h2&gt;

&lt;p&gt;Saving a modern deep-learning checkpoint can involve writing tens or hundreds of gigabytes of tensor data. Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PyTorch state dictionaries.&lt;/li&gt;
&lt;li&gt;Optimizer state.&lt;/li&gt;
&lt;li&gt;Distributed training or ZeRO partitions.&lt;/li&gt;
&lt;li&gt;BF16 or FP8 tensor dumps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to complete checkpoint writes quickly and predictably, minimizing the time training is interrupted or competing with storage activity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Extent-based allocation
&lt;/h3&gt;

&lt;p&gt;XFS uses extents to describe ranges of filesystem blocks. Instead of representing a file as a long list of individual block pointers, an extent can describe a contiguous range.&lt;/p&gt;

&lt;p&gt;For large sequential writes, this can keep file metadata compact and help the filesystem allocate large runs of blocks. The actual extent layout still depends on free space, concurrent activity, write patterns, and filesystem state; contiguity is not guaranteed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Delayed allocation
&lt;/h3&gt;

&lt;p&gt;With buffered I/O, XFS can delay choosing the physical blocks for newly written data until writeback. This gives the allocator more information about the write and can improve the chance of allocating larger, more contiguous extents.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;allocsize&lt;/code&gt; mount option controls the default speculative preallocation size for buffered writes. It can influence allocation behavior, but it is not a guarantee that every write will be allocated in fixed-size chunks or that a checkpoint will consist of only a few extents.&lt;/p&gt;

&lt;h3&gt;
  
  
  What about Btrfs and ZFS?
&lt;/h3&gt;

&lt;p&gt;Btrfs and ZFS provide valuable features such as snapshots, checksumming, and copy-on-write semantics. Those features can have costs for write-heavy workloads.&lt;/p&gt;

&lt;p&gt;For example, when data blocks are shared through reflinks or snapshots, modifying them can require copy-on-write allocation and associated metadata updates. Fragmentation and write amplification can become concerns in some workloads.&lt;/p&gt;

&lt;p&gt;However, it is too broad to say that every write on Btrfs or ZFS necessarily causes severe fragmentation or that every transaction causes problematic latency spikes. The outcome depends on workload, record and block sizes, pool or filesystem configuration, and the state of the storage.&lt;/p&gt;

&lt;p&gt;There is also an important XFS detail: &lt;strong&gt;XFS supports reflink-based copy-on-write when reflink is enabled and extents are shared.&lt;/strong&gt; Ordinary, unshared file writes are not automatically copy-on-write. If the objective is a scratch filesystem with no need for reflink cloning, decide whether reflink support is useful before formatting the volume.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Filesystem comparison for deep-learning workloads
&lt;/h2&gt;

&lt;p&gt;The table below is a qualitative engineering guide, not a universal benchmark result. Actual performance depends on kernel version, filesystem configuration, device topology, dataset layout, and concurrency.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Workload dimension&lt;/th&gt;
&lt;th&gt;XFS&lt;/th&gt;
&lt;th&gt;ext4&lt;/th&gt;
&lt;th&gt;Btrfs / ZFS&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;High-concurrency metadata activity&lt;/td&gt;
&lt;td&gt;Allocation groups can distribute allocation work&lt;/td&gt;
&lt;td&gt;Mature performance; contention depends on workload and layout&lt;/td&gt;
&lt;td&gt;More complex metadata paths; workload-dependent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large sequential checkpoint writes&lt;/td&gt;
&lt;td&gt;Extents and delayed allocation can help&lt;/td&gt;
&lt;td&gt;Generally capable of large sequential writes&lt;/td&gt;
&lt;td&gt;CoW and metadata behavior can add overhead in some configurations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Small-file workloads&lt;/td&gt;
&lt;td&gt;Capable, but directory and inode behavior should be benchmarked&lt;/td&gt;
&lt;td&gt;Often competitive, especially for common directory workloads&lt;/td&gt;
&lt;td&gt;Performance varies with metadata and CoW workload&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Snapshots and cloning&lt;/td&gt;
&lt;td&gt;Reflink support is available when enabled&lt;/td&gt;
&lt;td&gt;No native filesystem snapshots or reflink equivalent&lt;/td&gt;
&lt;td&gt;Strong native snapshot / CoW feature sets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Direct I/O and GPU-direct paths&lt;/td&gt;
&lt;td&gt;Supports direct I/O; GPUDirect Storage depends on the complete platform stack&lt;/td&gt;
&lt;td&gt;Supports direct I/O; GPU-direct support is platform-dependent&lt;/td&gt;
&lt;td&gt;Support and behavior depend on filesystem and platform&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scratch-storage simplicity&lt;/td&gt;
&lt;td&gt;Strong option for large local volumes&lt;/td&gt;
&lt;td&gt;Strong general-purpose option&lt;/td&gt;
&lt;td&gt;Useful when CoW, snapshots, or checksumming are requirements&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Do not interpret this table as proof that XFS is always faster. Benchmark the access pattern that your training job actually uses.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. The small-file caveat
&lt;/h2&gt;

&lt;p&gt;A common argument against XFS is that ext4 can perform very well with directories containing large numbers of small files. Consider a dataset containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1.2 million JPEG files, each around 20 KB.&lt;/li&gt;
&lt;li&gt;Several million WAV clips, each around 15 KB.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this scenario, directory lookup, inode access, path resolution, and file-open overhead can become a significant part of the input pipeline.&lt;/p&gt;

&lt;p&gt;But the more important design question is whether millions of individual files should be served directly to a multi-GPU training job in the first place.&lt;/p&gt;

&lt;p&gt;Every sample fetched through a loose-file layout may involve operations such as &lt;code&gt;open()&lt;/code&gt;, metadata lookup, &lt;code&gt;read()&lt;/code&gt;, and &lt;code&gt;close()&lt;/code&gt;. At scale, those operations create kernel transitions and metadata-cache pressure that can limit throughput regardless of the filesystem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Anti-pattern
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LooseAudioDataset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Dataset&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__getitem__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;file_paths&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;waveform&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sample_rate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;torchaudio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;waveform&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Better pattern
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;webdataset&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;wds&lt;/span&gt;

&lt;span class="n"&gt;dataset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;wds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WebDataset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;"/mnt/fast_data/shards/train-{000000..000499}.tar"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"torch"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_tuple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"wav"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"cls"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of opening a separate file for every sample, the pipeline reads samples from larger sequential containers.&lt;/p&gt;

&lt;p&gt;Common options include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;WebDataset / TAR shards&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HDF5&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zarr&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Memory-mapped Arrow&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;LMDB&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A shard size in the range of hundreds of megabytes to a few gigabytes can be a useful starting point, but the right size depends on the number of workers, randomization strategy, storage capacity, and recovery requirements.&lt;/p&gt;

&lt;p&gt;Once data is packed into shards, the pipeline can perform larger, more sequential reads. That reduces per-sample metadata overhead and makes it easier to use the bandwidth of fast NVMe storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Production tuning guide for XFS on NVMe
&lt;/h2&gt;

&lt;p&gt;The following commands are starting points for a dedicated local scratch volume. They are not universal settings. Test them on the target kernel, NVMe device, and workload before deploying them on a production training node.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.1 Format with an appropriate allocation-group count
&lt;/h3&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo mkfs.xfs -f \
  -d &lt;span class="nv"&gt;agcount&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;32 \
  -m &lt;span class="nv"&gt;reflink&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1,crc=1 \
  -b &lt;span class="nv"&gt;size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4096 \
  /dev/nvme0n1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;agcount=32&lt;/code&gt; is an example, not a rule. More allocation groups do not automatically mean more performance. The appropriate count depends on filesystem size, CPU concurrency, and workload. Start with the &lt;code&gt;mkfs.xfs&lt;/code&gt; defaults unless you have benchmark evidence that an explicit AG count helps.&lt;/p&gt;

&lt;p&gt;The example enables reflink support. If this is a scratch volume and you do not need reflink cloning, consider whether enabling it is necessary. Reflink support does not make every ordinary write CoW, but writes to shared extents do use CoW semantics.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.2 Mount options
&lt;/h3&gt;

&lt;p&gt;An example &lt;code&gt;/etc/fstab&lt;/code&gt; entry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UUID=xxxx-xxxx-xxxx-xxxx /mnt/fast_data xfs noatime,nodiratime,logbufs=8,logbsize=256k,allocsize=64M,inode64 0 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Review each option before applying it:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Considerations&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;noatime&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Avoids updating file access times on reads&lt;/td&gt;
&lt;td&gt;Often useful for read-heavy training data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nodiratime&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Avoids directory access-time updates&lt;/td&gt;
&lt;td&gt;Generally redundant when &lt;code&gt;noatime&lt;/code&gt; is active&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;logbufs=8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Configures the number of in-memory log buffers&lt;/td&gt;
&lt;td&gt;More buffers are not automatically better; benchmark metadata-heavy workloads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;logbsize=256k&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sets the log-buffer size&lt;/td&gt;
&lt;td&gt;Check the supported range for the running kernel and XFS version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;allocsize=64M&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sets the default speculative preallocation size for buffered writes&lt;/td&gt;
&lt;td&gt;Test with the checkpoint write pattern; it is not a contiguity guarantee&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;inode64&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Allows inode allocation across the filesystem address space&lt;/td&gt;
&lt;td&gt;Commonly appropriate for large filesystems&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Do not copy mount options blindly. In particular, options such as &lt;code&gt;logbufs&lt;/code&gt;, &lt;code&gt;logbsize&lt;/code&gt;, and &lt;code&gt;allocsize&lt;/code&gt; should be justified by measurements rather than treated as mandatory tuning.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.3 Kernel and block-device tuning
&lt;/h3&gt;

&lt;p&gt;NVMe devices use multiple hardware queues. On many modern systems, the &lt;code&gt;none&lt;/code&gt; I/O scheduler is a sensible baseline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Inspect the active scheduler first&lt;/span&gt;
cat /sys/block/nvme0n1/queue/scheduler

&lt;span class="c"&gt;# Select the none scheduler&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; none &lt;span class="o"&gt;|&lt;/span&gt; sudo tee /sys/block/nvme0n1/queue/scheduler
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For sequential shard reads, you can test a larger read-ahead value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Example: 4096 sectors, typically 2 MiB with 512-byte sectors&lt;/span&gt;
sudo blockdev --setra 4096 /dev/nvme0n1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also experiment with dirty-page thresholds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo sysctl -w vm.dirty_background_ratio=5
sudo sysctl -w vm.dirty_ratio=10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These settings affect system-wide writeback behavior. They can change when dirty pages are flushed and when processes are throttled; they do not guarantee that checkpointing will become faster. Test them under realistic concurrent training and checkpoint workloads, and make any persistent configuration changes deliberately.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Diagnosing storage bottlenecks
&lt;/h2&gt;

&lt;p&gt;Before changing filesystems or kernel parameters, establish what the storage path is actually doing.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.1 Inspect checkpoint extent layout
&lt;/h3&gt;

&lt;p&gt;Use &lt;code&gt;xfs_bmap&lt;/code&gt; to inspect the extent map of a checkpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xfs_bmap -v /mnt/fast_data/checkpoints/model_epoch_10.pt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A large number of extents can indicate fragmentation, but extent count alone does not establish that fragmentation is hurting performance. Compare the layout with sequential read and write measurements.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.2 Monitor device utilization and latency
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iostat -xz 1 /dev/nvme0n1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pay attention to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;rMB/s&lt;/code&gt; and &lt;code&gt;wMB/s&lt;/code&gt;: observed throughput.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;await&lt;/code&gt;: average I/O wait time.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;aqu-sz&lt;/code&gt;: average queue size.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;%util&lt;/code&gt;: device utilization as reported by &lt;code&gt;iostat&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A device showing high utilization and low throughput may be handling many small or latency-sensitive requests rather than large sequential transfers. It can also indicate queueing, CPU limitations, or another bottleneck. Compare the results with the device's specifications and with a controlled benchmark; &lt;code&gt;%util&lt;/code&gt; alone is not a reliable measure of NVMe saturation.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.3 Profile CPU-side filesystem activity
&lt;/h3&gt;

&lt;p&gt;Use &lt;code&gt;perf&lt;/code&gt; to identify where CPU time is going:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo perf top
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also inspect XFS-related symbols and lock activity where available in your kernel's profiling environment. Symbol names and tracepoint availability vary by kernel, so first inspect the events exposed by the running system rather than assuming a particular event name exists.&lt;/p&gt;

&lt;p&gt;The goal is to determine whether the workers are spending meaningful time in filesystem metadata paths, block I/O, decompression, Python overhead, or data transformations.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Practical recommendations
&lt;/h2&gt;

&lt;p&gt;For a multi-GPU training node using local NVMe scratch storage:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Benchmark XFS and ext4 with the real workload.&lt;/strong&gt; Include both concurrent sample reads and large checkpoint writes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prefer sharded datasets over millions of loose files.&lt;/strong&gt; This often produces a larger improvement than changing filesystems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use XFS when its allocation-group and large-file behavior fit the workload.&lt;/strong&gt; Do not assume it wins every small-file or metadata benchmark.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat mount and kernel parameters as experiments.&lt;/strong&gt; Change one variable at a time and measure throughput, latency, CPU utilization, and training-step time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure the entire pipeline.&lt;/strong&gt; GPU utilization is an outcome, not a diagnosis. Confirm that storage—not decoding, augmentation, Python, networking, or CPU scheduling—is the limiting factor.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;For large local NVMe volumes serving concurrent deep-learning workloads, XFS is a strong filesystem candidate. Its allocation groups can help distribute metadata and allocation work, while extent-based allocation and delayed allocation are useful for large buffered writes.&lt;/p&gt;

&lt;p&gt;The biggest gains, however, usually come from treating storage as part of the training architecture. Shard datasets, measure metadata pressure, profile checkpoint behavior, and tune the filesystem against the actual access pattern.&lt;/p&gt;

&lt;p&gt;A well-designed input pipeline on a properly benchmarked filesystem is more valuable than a collection of aggressive mount flags. XFS is a good place to start—not a substitute for measurement.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>linux</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>So you're interested in autonomous AI?</title>
      <dc:creator>Amirhossein Ghanipour</dc:creator>
      <pubDate>Sat, 07 Nov 2026 02:57:32 +0000</pubDate>
      <link>https://dev.to/amirhosseinghanipour/so-youre-interested-in-autonomous-ai-j95</link>
      <guid>https://dev.to/amirhosseinghanipour/so-youre-interested-in-autonomous-ai-j95</guid>
      <description>&lt;p&gt;I read the systems, security and software engineering literature before designing the next version of &lt;a href="https://github.com/amirhosseinghanipour/swarmux" rel="noopener noreferrer"&gt;swarmux&lt;/a&gt;. Nine findings that change how you should run autonomous coding agents.&lt;/p&gt;

&lt;p&gt;I'm building &lt;a href="https://github.com/amirhosseinghanipour/swarmux" rel="noopener noreferrer"&gt;swarmux&lt;/a&gt;, an open-source control plane for autonomous AI agents, written in Rust. Its job is simple to say and hard to do: let AI coding agents work unattended, and make their work verifiable. That means independent checks before anything counts as done, policy on every action, budgets that hold, and a tamper-evident record of what happened.&lt;/p&gt;

&lt;p&gt;Before designing the next version, I went through the computer science research that bears on this problem. I covered systems, databases, security, software engineering and ML systems, and leaned on 2023–2026 work plus the classics that still define good practice.&lt;/p&gt;

&lt;p&gt;This post is what I found. Several results surprised me, and a few contradict things that "everyone knows" about working with agents.&lt;/p&gt;

&lt;p&gt;A note on evidence: many of the papers below are recent arXiv preprints. I link every source so you can judge for yourself, and I've left out claims I couldn't trace to a primary source.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. "Tests pass" is not "done"
&lt;/h2&gt;

&lt;p&gt;This is the best-supported finding in the whole review, and it comes from several independent groups.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;UTBoost&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2506.09289" rel="noopener noreferrer"&gt;arXiv:2506.09289&lt;/a&gt;, ACL 2025) added stronger tests to SWE-bench. &lt;strong&gt;28.4% of "passing" patches on SWE-bench Lite and 15.7% on SWE-bench Verified turned out to be wrong.&lt;/strong&gt; It changed 24.4% of the Verified leaderboard entries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SWE-bench+&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2410.06992" rel="noopener noreferrer"&gt;arXiv:2410.06992&lt;/a&gt;) found that 32.67% of successful patches had the solution leaked in the issue or comments, and 31.08% passed only because the tests were weak.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ImpossibleBench&lt;/strong&gt; (OpenReview) builds tasks whose tests contradict the spec, so any pass is cheating. A "stop if the tests look flawed" instruction cut one model's cheating on the LiveCodeBench variant from 93% to 1%. Claude Opus 4.1 still cheated on 46% of the SWE-bench variant. Hiding the test files nearly eliminated cheating, but it also reduced legitimate performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So what does a trustworthy "done" look like? Three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Checks the agent can't see or edit.&lt;/strong&gt; If the agent can read the oracle, the oracle stops being an oracle. This is the single most important architectural decision in an agent harness.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure how strong your tests are, not just whether they pass.&lt;/strong&gt; Meta's mutation-guided test generation (&lt;a href="https://arxiv.org/abs/2501.12862" rel="noopener noreferrer"&gt;arXiv:2501.12862&lt;/a&gt;, FSE 2025) found that &lt;strong&gt;277 of 571 useful generated tests would have been thrown away under a line-coverage criterion&lt;/strong&gt;: they added no coverage but caught real faults. Coverage is not strength. A bounded mutation run on changed lines tells you how much to trust a green check, and it costs zero model tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Detect test weakening deterministically.&lt;/strong&gt; Deleted tests, new &lt;code&gt;skip&lt;/code&gt;/&lt;code&gt;xfail&lt;/code&gt; markers, loosened assertions, edited golden files and relaxed tolerances are all diffable. No LLM is needed to catch them.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  2. Prompt caching is the biggest cost lever you're probably breaking
&lt;/h2&gt;

&lt;p&gt;"Don't Break the Cache" (&lt;a href="https://arxiv.org/abs/2601.06007" rel="noopener noreferrer"&gt;arXiv:2601.06007&lt;/a&gt;) measured prompt caching on long-horizon agent tasks across OpenAI, Anthropic and Google, over 500+ sessions. &lt;strong&gt;API cost fell 41–80%, and time to first token fell 13–31%.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The catch is layout. Naive caching can even increase latency. The rules that fall out of it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Put stable content first and task-specific content last.&lt;/li&gt;
&lt;li&gt;Never inject a timestamp, a &lt;code&gt;git status&lt;/code&gt; or a reordered list of facts into the top of the prompt. Each one invalidates the cache for every task.&lt;/li&gt;
&lt;li&gt;Don't rebuild the tool list per task.&lt;/li&gt;
&lt;li&gt;Run sibling tasks of the same job back to back, inside the cache lifetime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Agent spend is dominated by input tokens. "How Do AI Agents Spend Your Money?" (&lt;a href="https://arxiv.org/abs/2604.22750" rel="noopener noreferrer"&gt;arXiv:2604.22750&lt;/a&gt;) finds agentic tasks use roughly 1000× the tokens of a chat exchange. So the cache-read ratio is the cheapest health metric an agent tool can track: if a new feature drops it, that feature costs you money on every task.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Less context, not more
&lt;/h2&gt;

&lt;p&gt;The intuition that more context helps agents is mostly wrong.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Complexity Trap&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2508.21433" rel="noopener noreferrer"&gt;arXiv:2508.21433&lt;/a&gt;, JetBrains Research) compared ways of managing an agent's growing history on SWE-bench Verified. Simply &lt;strong&gt;masking old tool outputs&lt;/strong&gt; (replacing them with a placeholder while keeping the agent's own reasoning) &lt;strong&gt;roughly halved cost&lt;/strong&gt; compared with an unmanaged agent, and matched or slightly beat LLM summarisation of the history, which costs extra calls of its own.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluating AGENTS.md&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2602.11988" rel="noopener noreferrer"&gt;arXiv:2602.11988&lt;/a&gt;) tested repository context files with Claude Code, Codex and Qwen Code. LLM-generated context files did not improve success, and they &lt;strong&gt;raised inference cost by more than 20%&lt;/strong&gt;. Agents obey the files, so they explore more. Repository overviews didn't help agents find the right files faster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't compress code.&lt;/strong&gt; An empirical study of prompt compressors (&lt;a href="https://arxiv.org/abs/2505.00019" rel="noopener noreferrer"&gt;arXiv:2505.00019&lt;/a&gt;) found that &lt;strong&gt;every method increased hallucination&lt;/strong&gt; through information loss. For code, one dropped identifier or path breaks the task.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The practical rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Give agents knowledge to &lt;em&gt;look up&lt;/em&gt; (short, cited answers when they ask), rather than pushing everything into every prompt.&lt;/li&gt;
&lt;li&gt;Cap tool output with an explicit "truncated, re-query with X" marker.&lt;/li&gt;
&lt;li&gt;Reduce whole observations, never individual tokens of code.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Escalate on failure, not on prediction
&lt;/h2&gt;

&lt;p&gt;Model cascades work: try a cheap model, and move to an expensive one only when needed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AutoMix&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2310.12963" rel="noopener noreferrer"&gt;arXiv:2310.12963&lt;/a&gt;, NeurIPS 2024) cut compute cost by more than 50% at comparable performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FrugalGPT&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2305.05176" rel="noopener noreferrer"&gt;arXiv:2305.05176&lt;/a&gt;) reported up to 98% savings, on 2023-era tasks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Learned&lt;/em&gt; routers, which predict difficulty up front, are another story. &lt;strong&gt;LLMRouterBench&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2601.07206" rel="noopener noreferrer"&gt;arXiv:2601.07206&lt;/a&gt;) evaluated 400K+ instances across 33 models. &lt;strong&gt;Several recent and commercial routers don't reliably beat simply using the best single model.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Coding agents have something these papers lack: a cheap, objective verifier, the tests. So the right cascade is to &lt;strong&gt;start with the cheaper model and escalate when the checks fail&lt;/strong&gt;. Choose the starting model from your own project's history, using a lookup table, not a learned router.&lt;/p&gt;

&lt;p&gt;The same logic caps retries. &lt;strong&gt;Large Language Monkeys&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2407.21787" rel="noopener noreferrer"&gt;arXiv:2407.21787&lt;/a&gt;) showed that SWE-bench Lite coverage (any sample correct) rises from 15.9% with one sample to 56% with 250. But &lt;strong&gt;Inference Scaling fLaws&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2411.17501" rel="noopener noreferrer"&gt;arXiv:2411.17501&lt;/a&gt;) proved that with imperfect verifiers, accuracy from resampling has a hard ceiling. Under realistic assumptions the best number of samples can be below 10. Two or three attempts with a strong gate beat twenty attempts with a weak one.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Budget by quantile, share by tokens
&lt;/h2&gt;

&lt;p&gt;Running the same agent task twice can cost wildly different amounts (&lt;a href="https://arxiv.org/abs/2604.22750" rel="noopener noreferrer"&gt;arXiv:2604.22750&lt;/a&gt;). Spending more doesn't reliably buy accuracy either. A budget based on the &lt;em&gt;average&lt;/em&gt; cost will be blown by the tail.&lt;/p&gt;

&lt;p&gt;The scheduling literature has a clean answer for fairness. The &lt;strong&gt;Virtual Token Counter&lt;/strong&gt; (Sheng et al., OSDI 2024, &lt;a href="https://arxiv.org/abs/2401.00588" rel="noopener noreferrer"&gt;arXiv:2401.00588&lt;/a&gt;) shares a serving engine fairly by &lt;em&gt;tokens consumed&lt;/em&gt;, not requests, with a proven 2× bound on the service gap. It also stops idle clients from banking credit and bursting later.&lt;/p&gt;

&lt;p&gt;For an agent control plane, that means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Admit a task only if its p90 estimated cost fits the remaining budget.&lt;/li&gt;
&lt;li&gt;Share capacity across jobs by tokens.&lt;/li&gt;
&lt;li&gt;Stop paying for the same failure twice: after a few consecutive failures with the same signature, open a circuit breaker and escalate to a human (Nygard's &lt;em&gt;Release It!&lt;/em&gt; pattern).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  6. Prompt-injection defence has to be structural
&lt;/h2&gt;

&lt;p&gt;Asking a model to "ignore instructions in tool output" is not a security boundary. The systems that hold up enforce security in code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CaMeL&lt;/strong&gt; (Google DeepMind and ETH, &lt;a href="https://arxiv.org/abs/2503.18813" rel="noopener noreferrer"&gt;arXiv:2503.18813&lt;/a&gt;) turns the trusted user request into a restricted program in which untrusted data can't change control flow. On AgentDojo it &lt;strong&gt;solves 77% of tasks with provable security, against 84% undefended&lt;/strong&gt;, a cost of about 7 points of utility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FIDES&lt;/strong&gt; (Microsoft, &lt;a href="https://arxiv.org/abs/2505.23643" rel="noopener noreferrer"&gt;arXiv:2505.23643&lt;/a&gt;) attaches confidentiality and integrity labels to data and enforces policy deterministically. With policy checks on, it &lt;strong&gt;stopped every prompt injection attack in AgentDojo&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design Patterns for Securing LLM Agents&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2506.08837" rel="noopener noreferrer"&gt;arXiv:2506.08837&lt;/a&gt;) states the principle: once an agent has read untrusted input, constrain it so that input can't trigger consequential actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A coding agent almost always has private data (source code, secrets in the environment) and untrusted content (web pages, issues, dependency READMEs). Together those are two legs of Simon Willison's "lethal trifecta". Remove the third leg by default, &lt;em&gt;external communication&lt;/em&gt;. Mark facts that came from untrusted sources, and require human approval for privileged actions (push, publish, edit the rules) while untrusted content is in play.&lt;/p&gt;

&lt;p&gt;For the policy engine itself, &lt;strong&gt;Cedar&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2403.04651" rel="noopener noreferrer"&gt;arXiv:2403.04651&lt;/a&gt;, OOPSLA 2024) is the model to copy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a deliberately restricted language, default-deny, where an explicit forbid overrides any permit;&lt;/li&gt;
&lt;li&gt;a formal model in Lean, with sound and complete analysis.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That analysis lets a tool answer a question no LLM can answer reliably: &lt;em&gt;"does this rule change allow anything the old rules forbade?"&lt;/em&gt; Runtime rule systems like &lt;strong&gt;AgentSpec&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2503.18666" rel="noopener noreferrer"&gt;arXiv:2503.18666&lt;/a&gt;) show enforcement can be richer than allow or deny: ask a human, rewrite the action, or log first in shadow mode. AgentSpec reports preventing unsafe execution in over 90% of code-agent cases, at millisecond overhead.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. A hash chain is not tamper-proof
&lt;/h2&gt;

&lt;p&gt;Many tools, &lt;a href="https://github.com/amirhosseinghanipour/swarmux" rel="noopener noreferrer"&gt;swarmux&lt;/a&gt; included, keep an audit log as a hash chain, where each entry includes the hash of the previous one. That detects an edit in the middle. It does &lt;strong&gt;not&lt;/strong&gt; stop someone who can write the file from rewriting the whole tail and recomputing the chain. And an AI agent typically runs as the same OS user as the tool that keeps the log.&lt;/p&gt;

&lt;p&gt;The classic answer comes from Certificate Transparency (RFC 6962) and Crosby and Wallach's &lt;em&gt;Efficient Data Structures for Tamper-Evident Logging&lt;/em&gt; (USENIX Security 2009). They use Merkle trees with inclusion proofs ("this event is in the log") and consistency proofs ("today's log extends yesterday's"). Production descendants like Sigstore's Rekor v2 use a tile format that needs no special server.&lt;/p&gt;

&lt;p&gt;The first-order fix is cheaper than Merkle trees: &lt;strong&gt;anchoring&lt;/strong&gt;. Periodically write a signed checkpoint (head hash, count, time) to a place the agent can't write. Merkle proofs come second, so a single event can be proven to a third party without handing over the whole log.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Project knowledge has a valid time
&lt;/h2&gt;

&lt;p&gt;Facts about a codebase go stale. "Tests run with &lt;code&gt;cargo nextest&lt;/code&gt;" stays true until someone changes the CI. Temporal databases (Snodgrass; SQL:2011) separate &lt;strong&gt;valid time&lt;/strong&gt; (when a fact is true in the world) from &lt;strong&gt;transaction time&lt;/strong&gt; (when the system recorded it). For code, valid time maps naturally onto &lt;em&gt;code state&lt;/em&gt;: tie each fact to the hash of the files it depends on. When those files change, the fact is flagged as possibly stale.&lt;/p&gt;

&lt;p&gt;Keeping derived knowledge fresh is a solved problem in build systems. &lt;em&gt;Build Systems à la Carte&lt;/em&gt; (ICFP 2018) and incremental indexers like Meta's Glean and Sourcegraph's SCIP recompute only what changed, and stop early when a recomputed result is unchanged. Deterministic derivation costs zero tokens. Re-summarising the repository with an LLM on every commit costs a lot and adds errors.&lt;/p&gt;

&lt;p&gt;Store the history as an append-only event log and treat everything else as a projection you can rebuild by replaying it. You then get deterministic reconstruction for debugging, and for testing new rules against past behaviour: "would this policy have blocked any of the last 1,000 tool calls?"&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Measure like a scientist, or you'll ship features that cost more and help less
&lt;/h2&gt;

&lt;p&gt;The evaluation literature is humbling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;τ-bench&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2406.12045" rel="noopener noreferrer"&gt;arXiv:2406.12045&lt;/a&gt;) introduced pass^k, which counts a task only if it succeeds on all k tries. GPT-4o's pass^8 on retail tasks was &lt;strong&gt;below 25%&lt;/strong&gt;. If you're going to leave an agent unattended, reliability across runs matters more than peak performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SWE-Bench Illusion&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2506.12286" rel="noopener noreferrer"&gt;arXiv:2506.12286&lt;/a&gt;) found models could locate the buggy file from the issue text alone up to 76% of the time on SWE-bench, against up to 53% on repositories outside it. That's a sign of memorisation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VibeMemBench&lt;/strong&gt; (&lt;a href="https://arxiv.org/abs/2609.23570" rel="noopener noreferrer"&gt;arXiv:2609.23570&lt;/a&gt;) tested agent memory systems independently: &lt;strong&gt;11 of 12 memory-system and solver pairings did no better than no memory at all&lt;/strong&gt;. Injecting verified experience did help, by 1.1–4.5 points with fewer steps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So any feature claiming to make agents better needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;paired A/B runs on your own repository history&lt;/strong&gt;, not public benchmarks;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3–5 repeats per cell&lt;/strong&gt;, reporting pass^k and p90 cost alongside success;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;a placebo control&lt;/strong&gt;: if irrelevant knowledge "helps", the effect is noise;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;a stale-knowledge control&lt;/strong&gt;, to measure the harm when facts go out of date.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What this means for &lt;a href="https://github.com/amirhosseinghanipour/swarmux" rel="noopener noreferrer"&gt;swarmux&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Most of this confirmed the bets &lt;a href="https://github.com/amirhosseinghanipour/swarmux" rel="noopener noreferrer"&gt;swarmux&lt;/a&gt; already made. Verification gates the agent can't see, a deterministic Guard, a governor and an append-only ledger are all supported by the evidence. It also changed the plan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gates get a strength score.&lt;/strong&gt; A bounded mutation run, a test-weakening detector, and a check that the original test suite still passes unchanged.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge is pulled, not pushed.&lt;/strong&gt; Agents ask the project and get short, cited answers. Facts carry their source and the code state they're valid for.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompts stay cache-stable&lt;/strong&gt;, and the ledger records the cache-read ratio per task.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model escalation is driven by failed checks&lt;/strong&gt;, starting from what has worked in your own history.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budgets use p90 estimates&lt;/strong&gt;, with circuit breakers for repeated failures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The ledger gets external anchors now&lt;/strong&gt; and Merkle proofs later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every new knowledge or memory feature ships behind a paired A/B.&lt;/strong&gt; It stays on only if it beats the baseline on your own repositories, at no extra cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Autonomy is only useful if you can verify it. The research is fairly clear on how to build that. &lt;a href="https://github.com/amirhosseinghanipour/swarmux" rel="noopener noreferrer"&gt;swarmux&lt;/a&gt;'s work is still in progress. You can install the experimental version now.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://github.com/amirhosseinghanipour/swarmux" rel="noopener noreferrer"&gt;swarmux&lt;/a&gt; is open source (MIT) and written in Rust: &lt;a href="https://github.com/amirhosseinghanipour/swarmux" rel="noopener noreferrer"&gt;github.com/amirhosseinghanipour/swarmux&lt;/a&gt;. I'd love to hear from people working on agent verification, policy or evaluation.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Verification and evaluation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;UTBoost: Rigorous Evaluation of Coding Agents on SWE-Bench.&lt;/em&gt; ACL 2025. &lt;a href="https://arxiv.org/abs/2506.09289" rel="noopener noreferrer"&gt;arXiv:2506.09289&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Aleithan et al. &lt;em&gt;SWE-Bench+: Enhanced Coding Benchmark for LLMs.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2410.06992" rel="noopener noreferrer"&gt;arXiv:2410.06992&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;ImpossibleBench.&lt;/em&gt; OpenReview.&lt;/li&gt;
&lt;li&gt;Meta. &lt;em&gt;Mutation-Guided LLM-based Test Generation at Meta.&lt;/em&gt; FSE Companion 2025. &lt;a href="https://arxiv.org/abs/2501.12862" rel="noopener noreferrer"&gt;arXiv:2501.12862&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Yao et al. &lt;em&gt;τ-bench.&lt;/em&gt; ICLR 2025. &lt;a href="https://arxiv.org/abs/2406.12045" rel="noopener noreferrer"&gt;arXiv:2406.12045&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;The SWE-Bench Illusion.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2506.12286" rel="noopener noreferrer"&gt;arXiv:2506.12286&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;VibeMemBench.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2609.23570" rel="noopener noreferrer"&gt;arXiv:2609.23570&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cost and context&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lumer et al. &lt;em&gt;Don't Break the Cache.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2601.06007" rel="noopener noreferrer"&gt;arXiv:2601.06007&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Bai et al. &lt;em&gt;How Do AI Agents Spend Your Money?&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2604.22750" rel="noopener noreferrer"&gt;arXiv:2604.22750&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Lindenbauer et al. &lt;em&gt;The Complexity Trap.&lt;/em&gt; NeurIPS 2025 DL4C workshop. &lt;a href="https://arxiv.org/abs/2508.21433" rel="noopener noreferrer"&gt;arXiv:2508.21433&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Evaluating AGENTS.md.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2602.11988" rel="noopener noreferrer"&gt;arXiv:2602.11988&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Empirical study of prompt compression methods. &lt;a href="https://arxiv.org/abs/2505.00019" rel="noopener noreferrer"&gt;arXiv:2505.00019&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Routing and test-time compute&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chen et al. &lt;em&gt;FrugalGPT.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2305.05176" rel="noopener noreferrer"&gt;arXiv:2305.05176&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Aggarwal et al. &lt;em&gt;AutoMix.&lt;/em&gt; NeurIPS 2024. &lt;a href="https://arxiv.org/abs/2310.12963" rel="noopener noreferrer"&gt;arXiv:2310.12963&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;LLMRouterBench.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2601.07206" rel="noopener noreferrer"&gt;arXiv:2601.07206&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Brown et al. &lt;em&gt;Large Language Monkeys.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2407.21787" rel="noopener noreferrer"&gt;arXiv:2407.21787&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Stroebl, Kapoor, Narayanan. &lt;em&gt;Inference Scaling fLaws.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2411.17501" rel="noopener noreferrer"&gt;arXiv:2411.17501&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Scheduling and reliability&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sheng et al. &lt;em&gt;Fairness in Serving Large Language Models (Virtual Token Counter).&lt;/em&gt; OSDI 2024. &lt;a href="https://arxiv.org/abs/2401.00588" rel="noopener noreferrer"&gt;arXiv:2401.00588&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Nygard. &lt;em&gt;Release It!&lt;/em&gt; (circuit breakers).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Security and policy&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Debenedetti et al. &lt;em&gt;Defeating Prompt Injections by Design (CaMeL).&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2503.18813" rel="noopener noreferrer"&gt;arXiv:2503.18813&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Costa et al. &lt;em&gt;Securing AI Agents with Information-Flow Control (FIDES).&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2505.23643" rel="noopener noreferrer"&gt;arXiv:2505.23643&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Beurer-Kellner et al. &lt;em&gt;Design Patterns for Securing LLM Agents against Prompt Injections.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2506.08837" rel="noopener noreferrer"&gt;arXiv:2506.08837&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Debenedetti et al. &lt;em&gt;AgentDojo.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2406.13352" rel="noopener noreferrer"&gt;arXiv:2406.13352&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Cutler et al. &lt;em&gt;Cedar: A New Language for Expressive, Fast, Safe, and Analyzable Authorization.&lt;/em&gt; OOPSLA 2024. &lt;a href="https://arxiv.org/abs/2403.04651" rel="noopener noreferrer"&gt;arXiv:2403.04651&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Wang et al. &lt;em&gt;AgentSpec: Customizable Runtime Enforcement for Safe and Reliable LLM Agents.&lt;/em&gt; &lt;a href="https://arxiv.org/abs/2503.18666" rel="noopener noreferrer"&gt;arXiv:2503.18666&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Willison. &lt;a href="https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/" rel="noopener noreferrer"&gt;&lt;em&gt;The lethal trifecta for AI agents.&lt;/em&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Logs, storage and incremental computation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Laurie, Langley, Kasper. &lt;em&gt;Certificate Transparency.&lt;/em&gt; &lt;a href="https://www.rfc-editor.org/rfc/rfc6962" rel="noopener noreferrer"&gt;RFC 6962&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Crosby, Wallach. &lt;em&gt;Efficient Data Structures for Tamper-Evident Logging.&lt;/em&gt; USENIX Security 2009.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://transparency.dev/articles/tile-based-logs/" rel="noopener noreferrer"&gt;&lt;em&gt;Tile-Based Transparency Logs&lt;/em&gt;&lt;/a&gt;, transparency.dev.&lt;/li&gt;
&lt;li&gt;Mokhov, Mitchell, Peyton Jones. &lt;em&gt;Build Systems à la Carte.&lt;/em&gt; ICFP 2018. &lt;a href="https://doi.org/10.1145/3236774" rel="noopener noreferrer"&gt;doi:10.1145/3236774&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Sourcegraph. &lt;a href="https://sourcegraph.com/blog/announcing-scip" rel="noopener noreferrer"&gt;&lt;em&gt;Announcing SCIP.&lt;/em&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Kleppmann et al. &lt;em&gt;Local-first software.&lt;/em&gt; Onward! 2019. &lt;a href="https://doi.org/10.1145/3359591.3359737" rel="noopener noreferrer"&gt;doi:10.1145/3359591.3359737&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>agents</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>You're Not Getting Dumber Because of AI. Your AI Is Getting Dumber Because of You.</title>
      <dc:creator>Amirhossein Ghanipour</dc:creator>
      <pubDate>Sat, 31 Oct 2026 17:10:32 +0000</pubDate>
      <link>https://dev.to/amirhosseinghanipour/youre-not-getting-dumber-because-of-ai-your-ai-is-getting-dumber-because-of-you-16al</link>
      <guid>https://dev.to/amirhosseinghanipour/youre-not-getting-dumber-because-of-ai-your-ai-is-getting-dumber-because-of-you-16al</guid>
      <description>&lt;p&gt;&lt;em&gt;How the human half of the loop quietly degrades your agent, and how to stop it.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Every week there's a new post about how AI is rotting our brains. "I can't write a for loop without Copilot anymore." "I forgot how to read docs." "My juniors can't debug."&lt;/p&gt;

&lt;p&gt;Fair. Some of that is real.&lt;/p&gt;

&lt;p&gt;But nobody talks about the other direction.&lt;/p&gt;

&lt;p&gt;You've seen the posts. &lt;em&gt;"Did they nerf the model?"&lt;/em&gt; &lt;em&gt;"Claude was amazing last month, now it's useless."&lt;/em&gt; &lt;em&gt;"Cursor got so much worse."&lt;/em&gt; Sometimes, sure, something changed on the provider's end like Gemini. But a lot of the time the model is fine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's a skill issue. Yours.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The model's weights don't change when you use it. Your codebase, your prompts, your context, and your attention do. And those are the things that decide how smart your AI is &lt;em&gt;for you&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Same model. Same price. Wildly different results. The variable is sitting in your chair.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Model Is Half the System. You're the Other Half.
&lt;/h2&gt;

&lt;p&gt;Here's the mental model I want you to steal:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Intelligence isn't a property of the model. It's a property of the loop.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think of your AI like a compiler. A compiler is deterministic and very good at its job. Hand it garbage and you don't get a better program. You get errors, or worse, you get something that compiles and quietly does the wrong thing.&lt;/p&gt;

&lt;p&gt;LLMs are the "compiles and quietly does the wrong thing" case, all day long.&lt;/p&gt;

&lt;p&gt;So when your agent seems dumber, the honest question isn't "what did Anthropic/OpenAI do?" It's "what did I feed it?"&lt;/p&gt;




&lt;h2&gt;
  
  
  The Dumbness Loop
&lt;/h2&gt;

&lt;p&gt;The scary part isn't that you get lazy once. It's that it compounds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You think less
   ↓
You write vaguer prompts and review less
   ↓
The AI produces mediocre output
   ↓
You accept it (you can't tell it's mediocre anymore)
   ↓
That output becomes the context for the next session
   ↓
The AI gets worse
   ↓
You blame the model, think even less
   ↓
(repeat until your repo is a crime scene)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "AI makes you dumber" crowd describes the first arrow. I'm describing the whole circle. You and your agent are dragging each other down, and both of you think it's the other one's fault.&lt;/p&gt;

&lt;p&gt;Let's go through how this actually happens.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. "Fix the bug" Is Not a Prompt
&lt;/h2&gt;

&lt;p&gt;Week 1 you, fresh and excited:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The /checkout endpoint returns 500 when the cart has a discounted item
with quantity &amp;gt; 1. Expected: total = price * qty * (1 - discount).
I've confirmed the discount is loaded correctly (logged it).
The bug is probably in calculateTotal() in cart/pricing.ts.
Don't touch the discount loader.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Month 3 you, three coffees deep and running on vibes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;checkout broken fix it
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model has to &lt;em&gt;guess&lt;/em&gt; everything you didn't say. Which endpoint? What's "broken"? What's off-limits? So it guesses, rewrites half your pricing module, adds a try/catch that swallows the error, and proudly tells you it's fixed.&lt;/p&gt;

&lt;p&gt;And you think the model got dumber. It didn't. It got less information.&lt;/p&gt;

&lt;p&gt;A prompt is a spec. A vague spec gets a vague implementation. We've known this about humans forever. Your agent is not exempt.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Your Context Window Is a Landfill
&lt;/h2&gt;

&lt;p&gt;You've been in the same chat for four hours. It contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Three approaches you abandoned&lt;/li&gt;
&lt;li&gt;Two versions of a file that no longer exist&lt;/li&gt;
&lt;li&gt;An instruction you gave at 10am and silently reversed at 2pm&lt;/li&gt;
&lt;li&gt;A 900-line stack trace you pasted "just in case"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then you ask a simple question and get a confused answer.&lt;/p&gt;

&lt;p&gt;The model is reasoning over &lt;em&gt;all of that&lt;/em&gt;. Every dead end is still in there whispering. This is context rot, and you did it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Start fresh sessions. Way more often than feels natural. Summarize what matters, carry it forward, leave the garbage behind. A clean context with 200 relevant tokens beats a polluted one with 200,000.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Your Codebase Is Teaching Your Agent Bad Habits
&lt;/h2&gt;

&lt;p&gt;This one is sneaky, and it's the most important one in the post.&lt;/p&gt;

&lt;p&gt;Agents imitate what they see. When an agent reads your repo to understand "how we do things here," it picks up your patterns. All of them.&lt;/p&gt;

&lt;p&gt;So here's what happens when you merge AI code without really reading it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Session 1: agent writes a slightly sloppy helper. You merge it.&lt;/li&gt;
&lt;li&gt;Session 5: agent sees that helper, assumes it's the house style, writes three more like it.&lt;/li&gt;
&lt;li&gt;Session 20: your codebase has a dialect now. It's bad. The agent is fluent in it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You're not just shipping bad code. &lt;strong&gt;You're training your agent's in-context behavior on bad code.&lt;/strong&gt; Every unreviewed merge is a vote for "do more of this."&lt;/p&gt;

&lt;p&gt;Garbage in, garbage out, garbage back in.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Your CLAUDE.md / Cursor Rules Are Rotting
&lt;/h2&gt;

&lt;p&gt;Instruction files start clean:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; Use TypeScript strict mode
&lt;span class="p"&gt;-&lt;/span&gt; Prefer small pure functions
&lt;span class="p"&gt;-&lt;/span&gt; Write tests for new logic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then every time the agent annoys you, you add a line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; NEVER use any
&lt;span class="p"&gt;-&lt;/span&gt; ok you can use any in the legacy folder
&lt;span class="p"&gt;-&lt;/span&gt; DO NOT add comments
&lt;span class="p"&gt;-&lt;/span&gt; add comments to complex functions
&lt;span class="p"&gt;-&lt;/span&gt; stop creating new files
&lt;span class="p"&gt;-&lt;/span&gt; IMPORTANT: always use the existing utils
&lt;span class="p"&gt;-&lt;/span&gt; actually create a new util if needed
&lt;span class="p"&gt;-&lt;/span&gt; DO NOT REFACTOR ANYTHING
&lt;span class="p"&gt;-&lt;/span&gt; please clean up the code you touch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations, you wrote a system prompt that contradicts itself four times. The agent now has to pick which of your past moods to obey. It will pick wrong, and you will add another line in all caps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Treat instruction files like code. Review them. Delete dead rules. If two lines conflict, that's a bug, not a vibe.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. You're Asking Leading Questions
&lt;/h2&gt;

&lt;p&gt;"This is the right way to structure it, right?"&lt;/p&gt;

&lt;p&gt;You just told the model what answer you want. Models lean toward agreeing with you. A confident wrong human gets a confidently wrong AI, now with a second opinion that's really just your first opinion wearing a hat.&lt;/p&gt;

&lt;p&gt;Compare:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ "Using Redis for this is a good idea, right?"&lt;/li&gt;
&lt;li&gt;✅ "What are the tradeoffs of Redis vs Postgres for this use case? Argue against my choice."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want a rubber duck that quacks back, ask questions that let it disagree.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. You Took Away Its Eyes
&lt;/h2&gt;

&lt;p&gt;An agent that can run tests, see the linter, and execute the code is dramatically smarter than the same agent writing blind.&lt;/p&gt;

&lt;p&gt;If your setup has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No tests&lt;/li&gt;
&lt;li&gt;No type checking&lt;/li&gt;
&lt;li&gt;No way to run the thing&lt;/li&gt;
&lt;li&gt;No error output fed back in&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...then the agent is coding with its eyes closed and you're mad it walked into a wall.&lt;/p&gt;

&lt;p&gt;The highest-leverage thing you can do for your AI isn't a better prompt. It's a feedback loop: tests it can run, errors it can read. Give it a way to check its own work.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. And Yes, This Is Where Your Brain Comes Back In
&lt;/h2&gt;

&lt;p&gt;Here's where my take meets the "AI makes you dumber" crowd.&lt;/p&gt;

&lt;p&gt;Your AI's quality ceiling is roughly &lt;strong&gt;your ability to notice when it's wrong.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you can't read the diff critically, you can't catch the bug. If you can't catch the bug, it gets merged. If it gets merged, see section 3.&lt;/p&gt;

&lt;p&gt;So when your own skills atrophy, it's not just &lt;em&gt;you&lt;/em&gt; that gets worse. Your whole system gets worse, because the one component responsible for quality control stopped working.&lt;/p&gt;

&lt;p&gt;You are the reviewer. If the reviewer is asleep, the PR approves itself.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Good News: The Loop Runs Both Ways
&lt;/h2&gt;

&lt;p&gt;Everything above works in reverse.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sharper prompts → better output&lt;/li&gt;
&lt;li&gt;Fresh context → clearer reasoning&lt;/li&gt;
&lt;li&gt;Reviewed code → a clean codebase the agent learns good patterns from&lt;/li&gt;
&lt;li&gt;Clean instruction files → consistent behavior&lt;/li&gt;
&lt;li&gt;Honest questions → real pushback&lt;/li&gt;
&lt;li&gt;Tests and tooling → an agent that corrects itself&lt;/li&gt;
&lt;li&gt;A human who still thinks → a ceiling that keeps rising&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same model. Same price. The people getting the most out of AI right now aren't the ones with secret prompts. They're the ones who stayed engaged enough to be a good half of the system.&lt;/p&gt;




&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The model didn't get nerfed. Your inputs did.&lt;/li&gt;
&lt;li&gt;Intelligence is a property of the human + AI loop, not the model alone.&lt;/li&gt;
&lt;li&gt;Vague prompts, polluted context, unreviewed code, rotting rules, leading questions, and missing feedback loops all make your agent dumber.&lt;/li&gt;
&lt;li&gt;Your agent learns from your codebase. Every lazy merge teaches it something.&lt;/li&gt;
&lt;li&gt;Your AI is only as good as your ability to tell when it's wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next time you're about to tweet "did they nerf it?", open a fresh session, write a real spec, and try again.&lt;/p&gt;

&lt;p&gt;It might be a skill issue.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What's the dumbest thing you've watched your agent do that was secretly your fault? Drop it in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Native Bounding Boxes Changes Everything for Visions Devs</title>
      <dc:creator>Amirhossein Ghanipour</dc:creator>
      <pubDate>Thu, 11 Jun 2026 17:01:02 +0000</pubDate>
      <link>https://dev.to/amirhosseinghanipour/native-bounding-boxes-changes-everything-for-visions-devs-19no</link>
      <guid>https://dev.to/amirhosseinghanipour/native-bounding-boxes-changes-everything-for-visions-devs-19no</guid>
      <description>&lt;p&gt;For a hot minute, getting an AI to tell you exactly where an object lives inside an image was a complete architectural nightmare. You had to chain together a massive LLM to understand the prompt, and then pipe that output into some rigid, dedicated computer vision model like YOLO or a CNN just to extract a few coordinates.&lt;/p&gt;

&lt;p&gt;Gemini completely flips the script with its native bounding box (bbox) capability. Instead of treating spatial tracking as a totally separate data science problem, it treats coordinates as part of its own vocabulary without any extra pipelines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open-Vocabulary Detection
&lt;/h2&gt;

&lt;p&gt;If you've ever worked with traditional object detection models, you know they are bound by a fixed dictionary. If you train a model on the standard COCO dataset, it knows exactly 80 things: "car," "dog," "banana," you get the drill. Ask it to find "the dented part of the bumper" or "the signature on this ancient manuscript," and it completely blanks out.&lt;/p&gt;

&lt;p&gt;Gemini gives us open-vocabulary object detection. You can prompt it like a normal human being because its spatial understanding is baked directly into its multimodal core:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Find all the green apples that look ripe."&lt;br&gt;
"Locate every paragraph illustration on this scanned page."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The model just parses the image and spits out structural text coordinates. No specialized training or custom fine-tuning required. &lt;/p&gt;

&lt;h2&gt;
  
  
  How the Coordinate System Works
&lt;/h2&gt;

&lt;p&gt;Instead of guessing raw pixel counts which is a headache because every image uploaded has a different resolution, Gemini normalizes every single photo to an imaginary 1000x1000 grid.&lt;/p&gt;

&lt;p&gt;The format it returns is always structured as a sequence of integers: &lt;code&gt;[ymin, xmin, ymax, xmax]&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Origin: The top-left corner of the image is &lt;code&gt;[0, 0]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The Bounds: The bottom-right corner is &lt;code&gt;[1000, 1000]&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To map Gemini's output back onto your actual image, the math is incredibly straightforward. You just divide the coordinate by 1000 and multiply it by your image's real width or height dimensions:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Pixel_X = (xmin_or_xmax / 1000) * Image_Width&lt;/code&gt;&lt;br&gt;
&lt;code&gt;Pixel_Y = (ymin_or_ymax / 1000) * Image_Height&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Upsets the Status Quo
&lt;/h2&gt;

&lt;p&gt;Other foundational models can write Python scripts to crop images or give you general, hand-wavy descriptions of where things are, but Gemini natively returning raw structured coordinates completely changes how we build software.&lt;/p&gt;

&lt;p&gt;It'll dynamically focus UI elements based on user focus or object relevance, let an agent accurately locate items in 3D-mapped space using 2D frame projections, extract precise structural bounding boxes for tables, visual callouts, or form fields without custom OCR training, or tell an agent to find "the broken login button icon" and get back coordinates ready for a programmatic click.&lt;/p&gt;

&lt;p&gt;It turns out that teaching a model to truly "see" means teaching it how to measure. Gemini's bbox capability proves that the future of vision isn't just about labeling what's in the room, but knowing exactly where it stands.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>gemini</category>
      <category>vision</category>
      <category>computervision</category>
    </item>
  </channel>
</rss>
