> ## Documentation Index
> Fetch the complete documentation index at: https://proto.evodesign.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Rejection Sampling Optimizer

> Draws many independent candidates from the generators, scores each against the constraints, and keeps the lowest-energy designs. Stateless and fully parallel, with no iterative refinement between samples.

<div class="page-hero">
  <div className="block dark:hidden">
    <svg viewBox="0 0 720 432" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Rejection sampling optimizer: accept/reject scatter under a target density capped by a proposal envelope" style={{width:"100%",height:"auto",display:"block"}}><defs><pattern id="gridrejL" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1.2" fill="#344649" fillOpacity="0.10" /></pattern><marker id="arrrejL" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 L3,5 z" fill="#768b8e" /></marker></defs><rect x="12" y="12" width="696" height="408" rx="16" fill="#f9fcfc" stroke="#dee9e8" strokeWidth="1.2" /><rect x="12" y="12" width="696" height="408" rx="16" fill="url(#gridrejL)" /><text x="360" y="56" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="13.5" fontWeight="600" fill="#1d2c2f" textAnchor="middle">each batch:  draw B → score → keep the K lowest-energy</text><path d="M120,80 L120,318 L600,318" fill="none" stroke="#c4d2d2" strokeWidth="1.4" /><text x="114" y="92" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="12" fontWeight="400" fill="#768b8e" textAnchor="end">p(x)</text><text x="360" y="348" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="12.5" fontWeight="400" fill="#768b8e" textAnchor="middle">x</text><path d="M120,295.67 C122,294.73 128,292.07 132,290.01 C136,287.95 140,285.74 144,283.33 C148,280.92 152,278.34 156,275.56 C160,272.79 164,269.82 168,266.67 C172,263.51 176,260.16 180,256.63 C184,253.11 188,249.38 192,245.5 C196,241.63 200,237.56 204,233.36 C208,229.17 212,224.8 216,220.35 C220,215.9 224,211.3 228,206.67 C232,202.04 236,197.28 240,192.56 C244,187.83 248,183.03 252,178.32 C256,173.61 260,168.88 264,164.3 C268,159.72 272,155.18 276,150.86 C280,146.54 284,142.32 288,138.38 C292,134.45 296,130.68 300,127.25 C304,123.82 308,120.62 312,117.8 C316,114.99 320,112.47 324,110.36 C328,108.26 332,106.5 336,105.18 C340,103.86 344,102.93 348,102.43 C352,101.94 356,101.87 360,102.22 C364,102.57 368,103.36 372,104.55 C376,105.74 380,107.36 384,109.34 C388,111.31 392,113.71 396,116.42 C400,119.12 404,122.21 408,125.55 C412,128.88 416,132.57 420,136.43 C424,140.28 428,144.44 432,148.7 C436,152.97 440,157.47 444,162.01 C448,166.55 452,171.26 456,175.96 C460,180.66 464,185.46 468,190.19 C472,194.91 476,199.68 480,204.34 C484,208.99 488,213.63 492,218.11 C496,222.6 500,227.01 504,231.25 C508,235.49 512,239.61 516,243.55 C520,247.48 524,251.27 528,254.85 C532,258.44 536,261.85 540,265.07 C544,268.29 548,271.32 552,274.16 C556,277 560,279.64 564,282.11 C568,284.58 572,286.86 576,288.97 C580,291.08 584,293.01 588,294.79 C592,296.58 598,298.85 600,299.67" fill="none" stroke="#b9c6c7" strokeWidth="2" /><path d="M120,318 C121.33,318 125.33,318 128,318 C130.67,318 133.33,318 136,318 C138.67,318 141.33,318 144,318 C146.67,318 149.33,318 152,318 C154.67,317.99 157.33,317.99 160,317.99 C162.67,317.98 165.33,317.98 168,317.96 C170.67,317.95 173.33,317.93 176,317.9 C178.67,317.86 181.33,317.82 184,317.74 C186.67,317.66 189.33,317.57 192,317.39 C194.67,317.22 197.33,317.03 200,316.67 C202.67,316.31 205.33,315.92 208,315.25 C210.67,314.58 213.33,313.83 216,312.66 C218.67,311.48 221.33,310.13 224,308.21 C226.67,306.29 229.33,304.06 232,301.13 C234.67,298.2 237.33,294.79 240,290.63 C242.67,286.48 245.33,281.66 248,276.21 C250.67,270.75 253.33,264.5 256,257.92 C258.67,251.33 261.33,243.94 264,236.7 C266.67,229.45 269.33,221.59 272,214.44 C274.67,207.3 277.33,199.93 280,193.83 C282.67,187.73 285.33,181.98 288,177.85 C290.67,173.72 293.33,170.55 296,169.06 C298.67,167.58 301.33,167.55 304,168.93 C306.67,170.31 309.33,173.41 312,177.33 C314.67,181.26 317.33,186.83 320,192.49 C322.67,198.16 325.33,205.07 328,211.33 C330.67,217.59 333.33,224.47 336,230.04 C338.67,235.62 341.33,241.07 344,244.78 C346.67,248.48 349.33,251.33 352,252.26 C354.67,253.19 357.33,252.63 360,250.36 C362.67,248.08 365.33,243.89 368,238.59 C370.67,233.3 373.33,226 376,218.57 C378.67,211.15 381.33,202.08 384,194.05 C386.67,186.02 389.33,177.17 392,170.39 C394.67,163.6 397.33,157.17 400,153.34 C402.67,149.5 405.33,147.22 408,147.39 C410.67,147.57 413.33,150.13 416,154.41 C418.67,158.68 421.33,165.54 424,173.03 C426.67,180.52 429.33,190.14 432,199.36 C434.67,208.57 437.33,219 440,228.35 C442.67,237.7 445.33,247.23 448,255.46 C450.67,263.68 453.33,271.29 456,277.72 C458.67,284.15 461.33,289.53 464,294.05 C466.67,298.58 469.33,301.98 472,304.86 C474.67,307.74 477.33,309.67 480,311.34 C482.67,313.01 485.33,314 488,314.89 C490.67,315.77 493.33,316.23 496,316.66 C498.67,317.09 501.33,317.27 504,317.46 C506.67,317.66 509.33,317.72 512,317.8 C514.67,317.88 517.33,317.9 520,317.93 C522.67,317.96 525.33,317.97 528,317.98 C530.67,317.99 533.33,317.99 536,317.99 C538.67,318 541.33,318 544,318 C546.67,318 549.33,318 552,318 C554.67,318 557.33,318 560,318 C562.67,318 565.33,318 568,318 C570.67,318 573.33,318 576,318 C578.67,318 581.33,318 584,318 C586.67,318 589.33,318 592,318 C594.67,318 598.67,318 600,318" fill="none" stroke="#046e7a" strokeWidth="2.4" /><circle cx="319.65" cy="309.82" r="3.2" fill="#2f8f6b" /><circle cx="326.88" cy="237.99" r="3.2" fill="#2f8f6b" /><circle cx="261.26" cy="268.4" r="3.2" fill="#2f8f6b" /><circle cx="426.06" cy="197.35" r="3.2" fill="#2f8f6b" /><circle cx="405.48" cy="210.69" r="3.2" fill="#2f8f6b" /><circle cx="385.39" cy="200.44" r="3.2" fill="#2f8f6b" /><circle cx="409.1" cy="225.22" r="3.2" fill="#2f8f6b" /><circle cx="331.02" cy="309.54" r="3.2" fill="#2f8f6b" /><circle cx="429.07" cy="201.86" r="3.2" fill="#2f8f6b" /><circle cx="464.78" cy="305.37" r="3.2" fill="#2f8f6b" /><circle cx="373.84" cy="263.61" r="3.2" fill="#2f8f6b" /><circle cx="435.96" cy="239.15" r="3.2" fill="#2f8f6b" /><circle cx="269.45" cy="245.64" r="3.2" fill="#2f8f6b" /><circle cx="316.71" cy="281.89" r="3.2" fill="#2f8f6b" /><circle cx="298.21" cy="187.35" r="3.2" fill="#2f8f6b" /><circle cx="257.96" cy="294.76" r="3.2" fill="#2f8f6b" /><circle cx="302.2" cy="305.6" r="3.2" fill="#2f8f6b" /><circle cx="312.53" cy="280.41" r="3.2" fill="#2f8f6b" /><circle cx="373.35" cy="295.51" r="3.2" fill="#2f8f6b" /><circle cx="381.47" cy="304.44" r="3.2" fill="#2f8f6b" /><circle cx="266.07" cy="288.96" r="3.2" fill="#2f8f6b" /><circle cx="413.93" cy="207.5" r="3.2" fill="#2f8f6b" /><circle cx="406.17" cy="235.4" r="3.2" fill="#2f8f6b" /><circle cx="296.03" cy="186.06" r="3.2" fill="#2f8f6b" /><circle cx="247.99" cy="286.7" r="3.2" fill="#2f8f6b" /><circle cx="308.99" cy="225.17" r="3.2" fill="#2f8f6b" /><circle cx="409.74" cy="260.26" r="3.2" fill="#2f8f6b" /><circle cx="267.2" cy="276.95" r="3.2" fill="#2f8f6b" /><circle cx="432.59" cy="287.94" r="3.2" fill="#2f8f6b" /><circle cx="418.61" cy="236.45" r="3.2" fill="#2f8f6b" /><circle cx="423.43" cy="261.96" r="3.2" fill="#2f8f6b" /><circle cx="426.28" cy="234.57" r="3.2" fill="#2f8f6b" /><circle cx="437.79" cy="259.09" r="3.2" fill="#2f8f6b" /><circle cx="444.58" cy="279.32" r="3.2" fill="#2f8f6b" /><circle cx="298" cy="178.08" r="3.2" fill="#2f8f6b" /><circle cx="392.85" cy="275.59" r="3.2" fill="#2f8f6b" /><circle cx="304.23" cy="181.4" r="3.2" fill="#2f8f6b" /><circle cx="403.28" cy="220.13" r="3.2" fill="#2f8f6b" /><circle cx="334.67" cy="298.03" r="3.2" fill="#2f8f6b" /><circle cx="389.12" cy="239.28" r="3.2" fill="#2f8f6b" /><circle cx="383.12" cy="219.98" r="3.2" fill="#2f8f6b" /><circle cx="375.18" cy="237.96" r="3.2" fill="#2f8f6b" /><circle cx="333.26" cy="278" r="3.2" fill="#2f8f6b" /><circle cx="309.46" cy="299.15" r="3.2" fill="#2f8f6b" /><circle cx="387.85" cy="206.87" r="3.2" fill="#2f8f6b" /><circle cx="262.65" cy="289.88" r="3.2" fill="#2f8f6b" /><circle cx="433.4" cy="282.96" r="3.2" fill="#2f8f6b" /><circle cx="292.51" cy="253.38" r="3.2" fill="#2f8f6b" /><circle cx="421.83" cy="207.33" r="3.2" fill="#2f8f6b" /><circle cx="348.6" cy="275.85" r="3.2" fill="#2f8f6b" /><circle cx="344.67" cy="285.09" r="3.2" fill="#2f8f6b" /><circle cx="413.5" cy="225.33" r="3.2" fill="#2f8f6b" /><circle cx="298.42" cy="266.73" r="3.2" fill="#2f8f6b" /><circle cx="327.91" cy="253.21" r="3.2" fill="#2f8f6b" /><circle cx="371.87" cy="274.18" r="3.2" fill="#2f8f6b" /><circle cx="415.32" cy="309.47" r="3.2" fill="#2f8f6b" /><circle cx="403.67" cy="296.21" r="3.2" fill="#2f8f6b" /><circle cx="275.26" cy="233.19" r="3.2" fill="#2f8f6b" /><circle cx="544.97" cy="299.7" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="481.53" cy="301.57" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="250.48" cy="265.51" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="544.66" cy="306.36" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="393.26" cy="152.86" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="179.08" cy="278.62" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="565.22" cy="298.81" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="227.15" cy="244.51" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="546.34" cy="287.75" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="499.35" cy="271" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="169.15" cy="294.25" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="148" cy="289.14" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="218.79" cy="284.09" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="206.49" cy="245.47" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="142.65" cy="304.86" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="523.76" cy="268.84" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="240.33" cy="199.63" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="194.41" cy="289.16" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="201.77" cy="285.96" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="207.09" cy="305.67" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="525.61" cy="294.77" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="586.18" cy="306.37" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="289.22" cy="162.71" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="514.8" cy="255.56" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="535.2" cy="267.21" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="156.79" cy="301.02" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="185.6" cy="281.89" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="284.09" cy="160.21" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="472.74" cy="211.99" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="249.33" cy="198.09" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="434" cy="203.26" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="152.21" cy="284.87" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="232.15" cy="260.09" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="137.54" cy="293.48" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="193.62" cy="268.98" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="189.47" cy="269.63" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="308.95" cy="166.35" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="222.08" cy="240.21" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="536.1" cy="295.82" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="336.52" cy="111.66" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="217.98" cy="279.22" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="546.43" cy="286.43" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="440.46" cy="178.51" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="342.91" cy="129.34" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="395.41" cy="161.95" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="550.56" cy="301.47" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="457.96" cy="206.96" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="177.55" cy="310.15" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="150.8" cy="304.51" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="154.75" cy="301.14" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="533.53" cy="282.73" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="523.25" cy="278.16" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="554.46" cy="284.55" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="529.32" cy="277.66" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="485.15" cy="244.05" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="583.55" cy="302.87" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="226.19" cy="219.8" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="193.51" cy="255.59" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="505.92" cy="240.73" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="185.79" cy="270.24" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="196.61" cy="296.63" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="135.05" cy="305.72" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="291.56" cy="165.87" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="236.75" cy="259.57" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="244.72" cy="239.13" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="452.2" cy="216.29" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="169.94" cy="290.8" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="292.75" cy="161.31" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="352.91" cy="179.79" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="544.58" cy="310.66" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="443.22" cy="244.65" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="475.05" cy="284.01" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="300.93" cy="170.65" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="363.49" cy="170.77" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="346.73" cy="144.9" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="545.04" cy="279.66" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="533" cy="291.18" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="547.07" cy="306.93" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="209.9" cy="254.47" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="586.48" cy="307.31" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="170.77" cy="281.15" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="175.73" cy="279.92" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="166.55" cy="275.27" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="152.21" cy="296.83" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="457.03" cy="248.16" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="193.42" cy="293.03" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="361.06" cy="193.22" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="570.39" cy="300.6" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="352.55" cy="139.16" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="218.61" cy="248.79" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="218.79" cy="258.42" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="163.02" cy="303.03" r="3" fill="#B4453F" fillOpacity="0.85" /><circle cx="282" cy="396" r="5.5" fill="#2f8f6b" /><text x="298" y="400" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#768b8e" textAnchor="start">accepted</text><circle cx="402" cy="396" r="5.5" fill="#B4453F" /><text x="418" y="400" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#768b8e" textAnchor="start">rejected</text></svg>
  </div>

  <div className="hidden dark:block">
    <svg viewBox="0 0 720 432" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Rejection sampling optimizer: accept/reject scatter under a target density capped by a proposal envelope" style={{width:"100%",height:"auto",display:"block"}}><defs><pattern id="gridrejD" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1.2" fill="#9eb4b2" fillOpacity="0.10" /></pattern><marker id="arrrejD" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 L3,5 z" fill="#7e9498" /></marker></defs><rect x="12" y="12" width="696" height="408" rx="16" fill="#0e1718" stroke="#2b3c3e" strokeWidth="1.2" /><rect x="12" y="12" width="696" height="408" rx="16" fill="url(#gridrejD)" /><text x="360" y="56" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="13.5" fontWeight="600" fill="#eef5f4" textAnchor="middle">each batch:  draw B → score → keep the K lowest-energy</text><path d="M120,80 L120,318 L600,318" fill="none" stroke="#3c4f51" strokeWidth="1.4" /><text x="114" y="92" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="12" fontWeight="400" fill="#9eb4b2" textAnchor="end">p(x)</text><text x="360" y="348" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="12.5" fontWeight="400" fill="#9eb4b2" textAnchor="middle">x</text><path d="M120,295.67 C122,294.73 128,292.07 132,290.01 C136,287.95 140,285.74 144,283.33 C148,280.92 152,278.34 156,275.56 C160,272.79 164,269.82 168,266.67 C172,263.51 176,260.16 180,256.63 C184,253.11 188,249.38 192,245.5 C196,241.63 200,237.56 204,233.36 C208,229.17 212,224.8 216,220.35 C220,215.9 224,211.3 228,206.67 C232,202.04 236,197.28 240,192.56 C244,187.83 248,183.03 252,178.32 C256,173.61 260,168.88 264,164.3 C268,159.72 272,155.18 276,150.86 C280,146.54 284,142.32 288,138.38 C292,134.45 296,130.68 300,127.25 C304,123.82 308,120.62 312,117.8 C316,114.99 320,112.47 324,110.36 C328,108.26 332,106.5 336,105.18 C340,103.86 344,102.93 348,102.43 C352,101.94 356,101.87 360,102.22 C364,102.57 368,103.36 372,104.55 C376,105.74 380,107.36 384,109.34 C388,111.31 392,113.71 396,116.42 C400,119.12 404,122.21 408,125.55 C412,128.88 416,132.57 420,136.43 C424,140.28 428,144.44 432,148.7 C436,152.97 440,157.47 444,162.01 C448,166.55 452,171.26 456,175.96 C460,180.66 464,185.46 468,190.19 C472,194.91 476,199.68 480,204.34 C484,208.99 488,213.63 492,218.11 C496,222.6 500,227.01 504,231.25 C508,235.49 512,239.61 516,243.55 C520,247.48 524,251.27 528,254.85 C532,258.44 536,261.85 540,265.07 C544,268.29 548,271.32 552,274.16 C556,277 560,279.64 564,282.11 C568,284.58 572,286.86 576,288.97 C580,291.08 584,293.01 588,294.79 C592,296.58 598,298.85 600,299.67" fill="none" stroke="#3c4f51" strokeWidth="2" /><path d="M120,318 C121.33,318 125.33,318 128,318 C130.67,318 133.33,318 136,318 C138.67,318 141.33,318 144,318 C146.67,318 149.33,318 152,318 C154.67,317.99 157.33,317.99 160,317.99 C162.67,317.98 165.33,317.98 168,317.96 C170.67,317.95 173.33,317.93 176,317.9 C178.67,317.86 181.33,317.82 184,317.74 C186.67,317.66 189.33,317.57 192,317.39 C194.67,317.22 197.33,317.03 200,316.67 C202.67,316.31 205.33,315.92 208,315.25 C210.67,314.58 213.33,313.83 216,312.66 C218.67,311.48 221.33,310.13 224,308.21 C226.67,306.29 229.33,304.06 232,301.13 C234.67,298.2 237.33,294.79 240,290.63 C242.67,286.48 245.33,281.66 248,276.21 C250.67,270.75 253.33,264.5 256,257.92 C258.67,251.33 261.33,243.94 264,236.7 C266.67,229.45 269.33,221.59 272,214.44 C274.67,207.3 277.33,199.93 280,193.83 C282.67,187.73 285.33,181.98 288,177.85 C290.67,173.72 293.33,170.55 296,169.06 C298.67,167.58 301.33,167.55 304,168.93 C306.67,170.31 309.33,173.41 312,177.33 C314.67,181.26 317.33,186.83 320,192.49 C322.67,198.16 325.33,205.07 328,211.33 C330.67,217.59 333.33,224.47 336,230.04 C338.67,235.62 341.33,241.07 344,244.78 C346.67,248.48 349.33,251.33 352,252.26 C354.67,253.19 357.33,252.63 360,250.36 C362.67,248.08 365.33,243.89 368,238.59 C370.67,233.3 373.33,226 376,218.57 C378.67,211.15 381.33,202.08 384,194.05 C386.67,186.02 389.33,177.17 392,170.39 C394.67,163.6 397.33,157.17 400,153.34 C402.67,149.5 405.33,147.22 408,147.39 C410.67,147.57 413.33,150.13 416,154.41 C418.67,158.68 421.33,165.54 424,173.03 C426.67,180.52 429.33,190.14 432,199.36 C434.67,208.57 437.33,219 440,228.35 C442.67,237.7 445.33,247.23 448,255.46 C450.67,263.68 453.33,271.29 456,277.72 C458.67,284.15 461.33,289.53 464,294.05 C466.67,298.58 469.33,301.98 472,304.86 C474.67,307.74 477.33,309.67 480,311.34 C482.67,313.01 485.33,314 488,314.89 C490.67,315.77 493.33,316.23 496,316.66 C498.67,317.09 501.33,317.27 504,317.46 C506.67,317.66 509.33,317.72 512,317.8 C514.67,317.88 517.33,317.9 520,317.93 C522.67,317.96 525.33,317.97 528,317.98 C530.67,317.99 533.33,317.99 536,317.99 C538.67,318 541.33,318 544,318 C546.67,318 549.33,318 552,318 C554.67,318 557.33,318 560,318 C562.67,318 565.33,318 568,318 C570.67,318 573.33,318 576,318 C578.67,318 581.33,318 584,318 C586.67,318 589.33,318 592,318 C594.67,318 598.67,318 600,318" fill="none" stroke="#0a7e8c" strokeWidth="2.4" /><circle cx="319.65" cy="309.82" r="3.2" fill="#2f8f6b" /><circle cx="326.88" cy="237.99" r="3.2" fill="#2f8f6b" /><circle cx="261.26" cy="268.4" r="3.2" fill="#2f8f6b" /><circle cx="426.06" cy="197.35" r="3.2" fill="#2f8f6b" /><circle cx="405.48" cy="210.69" r="3.2" fill="#2f8f6b" /><circle cx="385.39" cy="200.44" r="3.2" fill="#2f8f6b" /><circle cx="409.1" cy="225.22" r="3.2" fill="#2f8f6b" /><circle cx="331.02" cy="309.54" r="3.2" fill="#2f8f6b" /><circle cx="429.07" cy="201.86" r="3.2" fill="#2f8f6b" /><circle cx="464.78" cy="305.37" r="3.2" fill="#2f8f6b" /><circle cx="373.84" cy="263.61" r="3.2" fill="#2f8f6b" /><circle cx="435.96" cy="239.15" r="3.2" fill="#2f8f6b" /><circle cx="269.45" cy="245.64" r="3.2" fill="#2f8f6b" /><circle cx="316.71" cy="281.89" r="3.2" fill="#2f8f6b" /><circle cx="298.21" cy="187.35" r="3.2" fill="#2f8f6b" /><circle cx="257.96" cy="294.76" r="3.2" fill="#2f8f6b" /><circle cx="302.2" cy="305.6" r="3.2" fill="#2f8f6b" /><circle cx="312.53" cy="280.41" r="3.2" fill="#2f8f6b" /><circle cx="373.35" cy="295.51" r="3.2" fill="#2f8f6b" /><circle cx="381.47" cy="304.44" r="3.2" fill="#2f8f6b" /><circle cx="266.07" cy="288.96" r="3.2" fill="#2f8f6b" /><circle cx="413.93" cy="207.5" r="3.2" fill="#2f8f6b" /><circle cx="406.17" cy="235.4" r="3.2" fill="#2f8f6b" /><circle cx="296.03" cy="186.06" r="3.2" fill="#2f8f6b" /><circle cx="247.99" cy="286.7" r="3.2" fill="#2f8f6b" /><circle cx="308.99" cy="225.17" r="3.2" fill="#2f8f6b" /><circle cx="409.74" cy="260.26" r="3.2" fill="#2f8f6b" /><circle cx="267.2" cy="276.95" r="3.2" fill="#2f8f6b" /><circle cx="432.59" cy="287.94" r="3.2" fill="#2f8f6b" /><circle cx="418.61" cy="236.45" r="3.2" fill="#2f8f6b" /><circle cx="423.43" cy="261.96" r="3.2" fill="#2f8f6b" /><circle cx="426.28" cy="234.57" r="3.2" fill="#2f8f6b" /><circle cx="437.79" cy="259.09" r="3.2" fill="#2f8f6b" /><circle cx="444.58" cy="279.32" r="3.2" fill="#2f8f6b" /><circle cx="298" cy="178.08" r="3.2" fill="#2f8f6b" /><circle cx="392.85" cy="275.59" r="3.2" fill="#2f8f6b" /><circle cx="304.23" cy="181.4" r="3.2" fill="#2f8f6b" /><circle cx="403.28" cy="220.13" r="3.2" fill="#2f8f6b" /><circle cx="334.67" cy="298.03" r="3.2" fill="#2f8f6b" /><circle cx="389.12" cy="239.28" r="3.2" fill="#2f8f6b" /><circle cx="383.12" cy="219.98" r="3.2" fill="#2f8f6b" /><circle cx="375.18" cy="237.96" r="3.2" fill="#2f8f6b" /><circle cx="333.26" cy="278" r="3.2" fill="#2f8f6b" /><circle cx="309.46" cy="299.15" r="3.2" fill="#2f8f6b" /><circle cx="387.85" cy="206.87" r="3.2" fill="#2f8f6b" /><circle cx="262.65" cy="289.88" r="3.2" fill="#2f8f6b" /><circle cx="433.4" cy="282.96" r="3.2" fill="#2f8f6b" /><circle cx="292.51" cy="253.38" r="3.2" fill="#2f8f6b" /><circle cx="421.83" cy="207.33" r="3.2" fill="#2f8f6b" /><circle cx="348.6" cy="275.85" r="3.2" fill="#2f8f6b" /><circle cx="344.67" cy="285.09" r="3.2" fill="#2f8f6b" /><circle cx="413.5" cy="225.33" r="3.2" fill="#2f8f6b" /><circle cx="298.42" cy="266.73" r="3.2" fill="#2f8f6b" /><circle cx="327.91" cy="253.21" r="3.2" fill="#2f8f6b" /><circle cx="371.87" cy="274.18" r="3.2" fill="#2f8f6b" /><circle cx="415.32" cy="309.47" r="3.2" fill="#2f8f6b" /><circle cx="403.67" cy="296.21" r="3.2" fill="#2f8f6b" /><circle cx="275.26" cy="233.19" r="3.2" fill="#2f8f6b" /><circle cx="544.97" cy="299.7" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="481.53" cy="301.57" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="250.48" cy="265.51" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="544.66" cy="306.36" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="393.26" cy="152.86" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="179.08" cy="278.62" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="565.22" cy="298.81" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="227.15" cy="244.51" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="546.34" cy="287.75" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="499.35" cy="271" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="169.15" cy="294.25" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="148" cy="289.14" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="218.79" cy="284.09" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="206.49" cy="245.47" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="142.65" cy="304.86" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="523.76" cy="268.84" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="240.33" cy="199.63" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="194.41" cy="289.16" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="201.77" cy="285.96" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="207.09" cy="305.67" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="525.61" cy="294.77" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="586.18" cy="306.37" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="289.22" cy="162.71" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="514.8" cy="255.56" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="535.2" cy="267.21" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="156.79" cy="301.02" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="185.6" cy="281.89" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="284.09" cy="160.21" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="472.74" cy="211.99" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="249.33" cy="198.09" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="434" cy="203.26" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="152.21" cy="284.87" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="232.15" cy="260.09" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="137.54" cy="293.48" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="193.62" cy="268.98" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="189.47" cy="269.63" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="308.95" cy="166.35" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="222.08" cy="240.21" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="536.1" cy="295.82" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="336.52" cy="111.66" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="217.98" cy="279.22" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="546.43" cy="286.43" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="440.46" cy="178.51" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="342.91" cy="129.34" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="395.41" cy="161.95" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="550.56" cy="301.47" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="457.96" cy="206.96" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="177.55" cy="310.15" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="150.8" cy="304.51" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="154.75" cy="301.14" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="533.53" cy="282.73" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="523.25" cy="278.16" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="554.46" cy="284.55" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="529.32" cy="277.66" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="485.15" cy="244.05" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="583.55" cy="302.87" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="226.19" cy="219.8" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="193.51" cy="255.59" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="505.92" cy="240.73" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="185.79" cy="270.24" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="196.61" cy="296.63" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="135.05" cy="305.72" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="291.56" cy="165.87" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="236.75" cy="259.57" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="244.72" cy="239.13" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="452.2" cy="216.29" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="169.94" cy="290.8" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="292.75" cy="161.31" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="352.91" cy="179.79" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="544.58" cy="310.66" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="443.22" cy="244.65" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="475.05" cy="284.01" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="300.93" cy="170.65" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="363.49" cy="170.77" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="346.73" cy="144.9" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="545.04" cy="279.66" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="533" cy="291.18" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="547.07" cy="306.93" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="209.9" cy="254.47" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="586.48" cy="307.31" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="170.77" cy="281.15" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="175.73" cy="279.92" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="166.55" cy="275.27" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="152.21" cy="296.83" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="457.03" cy="248.16" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="193.42" cy="293.03" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="361.06" cy="193.22" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="570.39" cy="300.6" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="352.55" cy="139.16" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="218.61" cy="248.79" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="218.79" cy="258.42" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="163.02" cy="303.03" r="3" fill="#cf6f68" fillOpacity="0.85" /><circle cx="282" cy="396" r="5.5" fill="#2f8f6b" /><text x="298" y="400" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#9eb4b2" textAnchor="start">accepted</text><circle cx="402" cy="396" r="5.5" fill="#cf6f68" /><text x="418" y="400" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#9eb4b2" textAnchor="start">rejected</text></svg>
  </div>
</div>

<p class="entity-disclaimer">This optimizer is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.</p>

<hr class="entity-rule" />

<div class="tool-tab-bar entity-source-bar"><span class="tool-tab-wrap"><span class="tool-tab badge-source entity-source-tab"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</span></span></div>

<a href="https://github.com/evo-design/proto-language/blob/d3b7822f74ea64747cc751a3b2ab1aa6b799ac47/proto_language/optimizer/rejection_sampling_optimizer.py#L179" target="_blank" class="tab-panel source-panel entity-source-panel">
  <div class="source-info">
    <img noZoom src="https://github.com/evo-design.png?size=40" class="source-avatar" width="36" height="36" />

    <span class="source-path">evo-design/proto-language<span class="source-subpath">/proto\_language/optimizer/rejection\_sampling\_optimizer.py</span></span>
  </div>

  <span class="panel-goto-btn source-goto-btn"><span><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" /></svg> View source</span></span>
</a>

<div class="entity-contributors"><span class="entity-contributors-label">Optimizer contributors</span><span class="entity-contributors-people"><a class="entity-contributor" href="https://github.com/dguo8412" target="_blank" rel="noopener" title="dguo8412: 6 commits"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/46211285?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">dguo8412</span></a><a class="entity-contributor" href="https://github.com/brianhie" target="_blank" rel="noopener" title="brianhie: 1 commit"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/6365340?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">brianhie</span></a></span></div>
Rejection Sampling optimizer for sequence optimization through extensive sampling.

Generates many proposal sequences and keeps only the best `num_results` by
lowest energy score. Unlike iterative optimizers (MCMC, beam search), each
proposal batch starts fresh from the captured result state (the prior-stage
results, or the original sequences on the first stage). There is no state
carried between rounds.

Each proposal batch:

1. Resets proposals to the captured result state
2. Applies all generators sequentially
3. Evaluates proposals with constraints
4. Updates the sorted results list if any proposals are better than the current worst
5. Reports each proposal as its own history iteration

If `energy_threshold` is set, the optimizer stops early once all best
proposals have energy below the threshold.

<Note>
  If filter constraints reject many proposals, the optimizer may return
  fewer than `num_results` valid results.
</Note>

## How It Works

Rejection sampling draws many independent proposals from the same starting point and keeps the `num_results` with the lowest energy, carrying no state between draws.

Each batch resets the proposal pool to the initial sequences (the optimizer is stateless), generates `B` new proposals, scores them, and folds survivors into a buffer of the `K = num_results` lowest-energy sequences kept in sorted order:

```
keep S = the K proposals with smallest energy E
insert x  ⇔  |S| < K  or  E(x) < max(S)        (bisect into sorted S, drop the worst)
stop early  ⇔  every s ∈ S has E(s) < energy_threshold
```

Batches repeat until `num_samples` proposals have been drawn (or the threshold is met). Because each batch restarts from the same initial pool, the search keeps no per-step state and is embarrassingly parallel.

## API Reference

<div class="api-model-section api-model-static api-config-section">
  <div class="api-model-header"><span class="api-model-badge api-config-badge">Config</span><span class="api-model-name">RejectionSamplingOptimizerConfig</span><a href="https://github.com/evo-design/proto-language/blob/d3b7822f74ea64747cc751a3b2ab1aa6b799ac47/proto_language/optimizer/rejection_sampling_optimizer.py#L91" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a></div>

  Configuration object for RejectionSamplingOptimizer.

  The Rejection Sampling optimizer generates or receives proposal sequences
  and keeps only the best `num_results` by lowest energy score. It processes
  generated proposals in internal batches and reports each proposal as the
  semantic iteration.

  <Note>
    If filter constraints reject many proposals (returning inf/nan energies),
    the optimizer may return fewer than `num_results` valid results.
  </Note>

  <ParamField path="num_samples" type="integer" required>
    Generated proposal count; in existing-results mode, candidate cap.
  </ParamField>

  <ParamField path="num_results" type="integer">
    Number of top-scoring candidate designs to retain (lowest energy first). Overrides program count.
  </ParamField>

  <ParamField path="proposal_source" type="string">
    Derived from the generator list when unset: generated if generators are present.
  </ParamField>

  <ParamField path="proposal_batch_size" type="integer">
    Proposals scored per internal batch. Inferred from component batch sizes if omitted.
  </ParamField>

  <ParamField path="energy_threshold" type="number">
    Optional early-stop (lower energy = better); stops once every retained candidate is below this.
  </ParamField>

  <ParamField path="seed" type="integer">
    Random seed for reproducible optimization, generator, and constraint tool streams.
  </ParamField>

  <ParamField path="tracking_interval" type="integer" default="1">
    Save history and log progress every N steps. Step 0 and final step always saved.
  </ParamField>

  <ParamField path="track_proposals" type="boolean" default="False">
    Save granular per-proposal results (accept/reject) in history snapshots.
  </ParamField>

  <ParamField path="verbose" type="boolean" default="False">
    Emit per-step debug information about proposals, scores, and acceptance through the logger.
  </ParamField>
</div>

## Usage

```python python icon="python" theme={null}
>>> config = RejectionSamplingOptimizerConfig(num_samples=100, num_results=10)
>>> optimizer = RejectionSamplingOptimizer(
...     constructs=constructs, generators=[mutation_gen], constraints=[gc_constraint], config=config
... )
>>> optimizer.run()
>>> best_sequences = optimizer.constructs[0].segments[0].result_sequences
```

With early stopping:

```python python icon="python" theme={null}
>>> config = RejectionSamplingOptimizerConfig(
...     num_samples=1000,
...     num_results=10,
...     energy_threshold=0.5,  # Stop when all top-10 have energy < 0.5
... )
```

## Metadata

| Property               | Value                        |
| ---------------------- | ---------------------------- |
| Key                    | `rejection-sampling`         |
| Class                  | `RejectionSamplingOptimizer` |
| Targets Single Segment | `False`                      |
| Uses GPU               | `False`                      |
