Headspacing matters (so you don't blow yourself up)
When guys decide to piece together their own AR-15 upper receiver, they usually buy a barrel from one manufacturer and a bolt carrier group from another. They slide the bolt into the upper, torque the barrel nut, and head to the range. Most of the time, the gun runs fine. But occasionally, a builder will assemble a rifle that constantly rips the rims off brass casings or simply refuses to let the bolt close all the way. When that happens, the forum advice is always to check the headspace, but a lot of guys don't actually understand what that term means mechanically or how to properly measure it.
Headspace is not the total length of the chamber. If you are shooting a bottlenecked cartridge like the 5.56 NATO or the .223 Remington, headspace is the exact physical distance from the flat face of the closed bolt to a very specific, angled point inside the chamber called the datum line. The datum line sits right on the shoulder of the chamber, exactly where the angled shoulder of the brass cartridge rests.
If the distance between the bolt face and that datum line is too short, the headspace is tight. When the heavy recoil spring shoves the bolt forward, the brass cartridge bottoms out on the chamber shoulder before the bolt is fully seated. Because the bolt is sitting slightly too far back, the steel lugs on the bolt head physically cannot rotate into the locking recesses inside the barrel extension. The gun refuses to go into battery.
If the distance is too long, the headspace is loose. This is a much bigger mechanical problem. When the firing pin detonates the primer, the brass casing instantly expands to grip the walls of the chamber. Because there is a physical gap between the base of the cartridge and the face of the bolt, the rear of the brass stretches backward to bridge that gap. Brass is only meant to stretch so far. If the headspace is excessively loose, the brass will stretch past its yield point and physically tear in half inside the chamber, leaving the front half of the casing firmly stuck in the steel.
You cannot measure this gap with standard calipers. You have to use precision-machined steel headspace gauges. A "Go" gauge is machined to match the absolute maximum allowable size of a live cartridge. If your rifle is in spec, the bolt should easily close and lock over a Go gauge. A "No-Go" gauge is machined slightly longer to represent the maximum safe dimension of an empty chamber. The bolt should physically stop and fail to rotate over a No-Go gauge.
Unlike a precision bolt-action rifle where you can adjust the headspace by threading a barrel nut, AR-15 headspace is fixed at the factory. The manufacturer threads the barrel extension onto the barrel and locks it permanently in place with a steel cross pin. If your AR-15 fails a gauge test, you can't just turn a wrench to fix it. You usually have to try swapping in a different bolt to see if the machined tolerances stack up tighter. I always keep a few spare bolts and a set of precision gauges from https://www.brownells.com/tools-cleaning/gunsmith-tools/headspace-gauges/ on the bench when mixing and matching upper parts. Stop guessing with your chamber dimensions. Use the gauges to find the datum line and ensure the brass has the exact right amount of breathing room.