We study a manufacturing process that is quite common in semiconductor
wafer fabrication. In generic terms, the job to be processed consists
of J units. To process the job, a ''setup'' is required, followed by
routine processing and testing. In principle, the entirety of the job
can be set up and processed in a single batch. However, the setup is p
rone to failure, leading to loss of units. Hence, in practice trial ru
ns are often conducted, with each trial involving a small batch of uni
ts. Here we identify an optimal control of such processes. The policy
prescribes a maximum of k (less-than-or-equal-to J) single-unit trial
runs. To establish optimality, we use the recently developed notion o
f stochastic convexity/concavity and related machinery.