Finding the first time a fluctuating quantity reaches a given boundary is a deceptively simple-looking problem of vast practical importance in physics, biology, chemistry, neuroscience, economics, and industrial engineering. Problems in which the bound to be traversed is itself a fluctuating function of time include widely studied problems in neural coding, such as neuronal integrators with irregular inputs and internal noise. We show that the probability p(t) that a Gauss-Markov process will first exceed the boundary at time t suffers a phase transition as a function of the roughness of the boundary, as measured by its Hölder exponent H. The critical value occurs when the roughness of the boundary equals the roughness of the process, so for diffusive processes the critical value is H c = 1/2. For smoother boundaries, H > 1/2, the probability density is a continuous function of time. For rougher boundaries, H < 1/2, the probability is concentrated on a Cantor-like set of zero measure: the probability density becomes divergent, almost everywhere either zero or infinity. The critical point H c = 1/2 corresponds to a widely studied case in the theory of neural coding, in which the external input integrated by a model neuron is a white-noise process, as in the case of uncorrelated but precisely balanced excitatory and inhibitory inputs. We argue that this transition corresponds to a sharp boundary between rate codes, in which the neural firing probability varies smoothly, and temporal codes, in which the neuron fires at sharply defined times regardless of the intensity of internal noise.first-passage time | neural code | random walk A Brownian process W(t) that starts at t = 0 from W(t = 0) = 0 will fluctuate up and down, eventually crossing the value 1 infinitely many times: for any given realization of the process W, there will be infinitely many different values of t for which W(t) = 1. Finding the very first such time,known as the "first passage" of the process through the boundary B = 1, is easier said than done, one of those classical problems whose concise statements conceal their difficulty (1-4). For general fluctuating random processes, the first-passage time problem is both extremely difficult (5-9) and highly relevant, due to its manifold practical applications: it models phenomena as diverse as the onset of chemical reactions (10-14), transitions of macromolecular assemblies (15-19), time-to-failure of a device (20)(21)(22), accumulation of evidence in neural decision-making circuits (23), the "gambler's ruin" problem in game theory (24), species extinction probabilities in ecology (25), survival probabilities of patients and disease progression (26-28), triggering of orders in the stock market (29-31), and firing of neural action potentials (32-37).Much attention has been devoted to two extensions of this basic problem. One is the first passage through a stationary boundary within a complex spatial geometry, such as diffusion in porous media or complex networks. These models are used to describe foragi...