TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Things I would have told myself before building an autorouter

396 点作者 seveibar大约 2 个月前

28 条评论

ChrisGammell大约 2 个月前
I&#x27;m generally in the &quot;never trust the autorouter&quot; camp (and by extension &quot;never trust the bevy of AI tools entering the space&quot;), but it&#x27;s undeniable there are some big opportunities in the eCAD space to speed up some aspects of layout. I&#x27;m probably more likely to use co-creation tools, rather than full auto tools, simply because I rely heavily on iteration. Many times when starting a design my placements aren&#x27;t set and that has a huge impact on routing. I didn&#x27;t see on your page whether placement was part of your algorithm. I already rely on tools like push and shove and occasionally auto complete.<p>I&#x27;m always curious about people entering the space though. It is a small market, IMO. The tools are fractured, the existing players are lumbering behemoths, and the users are cranky zealots (you will have to pry KiCad out of my cold dead hands). I noted the step about the AR being written in JavaScript, which I have no real opinion on, but I&#x27;m curious about plans to plug into ecosystems (CAD vendors, OS tools) or try and draw people into another new ecosystem.
评论 #43501264 未加载
评论 #43506243 未加载
评论 #43501499 未加载
评论 #43503671 未加载
评论 #43503983 未加载
GistNoesis大约 2 个月前
Point 8, the fast dismissal of Monte-Carlo method is a huge blunder.<p>The point of Monte-Carlo method is that you can tradeoff accuracy for speed. The longer you run your algorithm the more accurate you get.<p>But what&#x27;s even more interesting is that we can often use the contrapositive : You can get shitty accurate result real fast.<p>Instead of exploring all paths, you explore only one path picked at random.<p>And that&#x27;s where it shines : when you put it into the most imbricated loop of your algorithm.<p>For example when you want to learn a neural network which autoroute. Typically you would have the outerloop which is updating the neural network parameter, and the inner-loop which is computing a path through the graph.<p>When you use Monte-Carlo this inner-loop which control accuracy can be reduced to 1 iteration if everything is bias-less, you will have a slower outerloop due to higher variance but the machine learning should &quot;&quot;&quot;theoretically&quot;&quot;&quot; learn.<p>This is what allows you to build policies which intuitively always pick the right decision. Like in chess or go, you have some monte-carlo tree search variant like alpha-go-zero or alpha-chess-zero or alpha-router-zero, where even without the search part, the giant cache (encoded by the neural network parameters), once trained, can compute your best guess path in one pass through your neural network aka constant time (with a constant which can easily trade memory for speed by augmenting the number of parameters or training for longer).
评论 #43506536 未加载
评论 #43509077 未加载
评论 #43505886 未加载
Animats大约 2 个月前
That&#x27;s a great discussion of autorouting. Then he ends with: <i>&quot;key piece to enable the “vibe-building” of electronics.&quot;</i> Ouch<p>Routing itself is easy. It&#x27;s when the router has to tear up stuff it already routed to fit new stuff in that things get complicated and the combinatorics start to get you.<p>I miss the autorouter KiCAD used to have. It was taken out for iffy IP reasons (the author had worked for an autorouting company). Reaction to users who wanted it back were along the lines of &quot;Real Men Don&#x27;t Use Autorouters&quot;.[1]<p>[1] <a href="https:&#x2F;&#x2F;forum.kicad.info&#x2F;t&#x2F;autorouting-and-autoplacement&#x2F;18569&#x2F;8" rel="nofollow">https:&#x2F;&#x2F;forum.kicad.info&#x2F;t&#x2F;autorouting-and-autoplacement&#x2F;185...</a>
评论 #43500882 未加载
评论 #43501599 未加载
n4r9大约 2 个月前
Article makes some important points - especially re visualisation and cache effects.<p>Some quibbles or glossovers:<p>&gt; A recursive algorithm is a depth first search. Any loop that explores candidates&#x2F;neighbors without sorting the candidates is a BFS.<p>Not sure what to say about this. It&#x27;s either wrong or I&#x27;m missing the intuition. Both DFS and BFS can either be written iteratively or recursively; the real difference is whether you pop your next candidate from the top or the bottom of the stack. Equivalently, whether you use a stack (FILO) or a queue (FIFO). That said, I took maths rather than CS so verify this for yourself.<p>&gt; It is simply the best foundation for any kind of informed search (not just for 2d grids!)<p>A* is useful in pathfinding if you have some notion of easily-computed &quot;distance&quot; to your desired target and you&#x27;re only running a few queries for any given graph. If you plan to run many queries on a mostly-static graph (like a road network) then you could be better off applying a pre-processing algorithm like contraction heirarchies. If you&#x27;re optimising but don&#x27;t know what target you&#x27;re aiming for (e.g. Traveling Salesman) then using some other local search heuristic like 2-opt may be better.<p>&gt; The major difference between these [A* and BFS] is BFS explores all adjacent nodes, while A* prioritizes exploring nodes that are closer to the destination.<p>This is definitely <i>a</i> difference. But it glosses over the biggest difference, which is that A* is a dynamic algorithm. That allows you to terminate early with confidence that you have found the shortest path. With BFS you may not be certain until you&#x27;ve searched the whole graph, which could be vast.
评论 #43505629 未加载
评论 #43508441 未加载
评论 #43509429 未加载
评论 #43504694 未加载
dkjaudyeqooe大约 2 个月前
&gt; The QuadTree and every general-purpose tree data structure are insanely slow. Trees are not an informed representation of your data.<p>&gt; Any time you’re using a tree you’re ignoring an O(~1) hash algorithm for a more complicated O(log(N)) algorithm<p>This is incredibly misguided. The hashing approach is fine if your points are evenly distributed and you only really want to query an area relatively close to the fixed subdivisions you&#x27;ve chosen, otherwise your 0(1) is going to degenerate to O(n).<p>Trees are an informed representation when you don&#x27;t know how your data is distributed.<p>Similar story for randomized algorithms. What happens when your search space is many trillions of items or possibilities? Or there are no heuristics to be had? If you can&#x27;t brute force it and you can&#x27;t use a clever algorithm then randomized algorithms are a savior.<p>Maybe these aren&#x27;t needed for this specific application, but best to not make sweeping statements.
评论 #43505198 未加载
评论 #43506333 未加载
MrLeap大约 2 个月前
Almost everything matches my gamedev heuristics. I even have empathy for choosing JS. I&#x27;m making a game modding framework right now that operates on a lispy kind of s-expressions. Optimizing to accelerate creative iteration time &gt; *, I&#x27;ve found.<p>A*, Lee&#x27;s algorithm and the like are all cool. It&#x27;s criminal to write any kind of floodfill without having an accompanying visualization, you&#x27;re squandering so much dopamine.<p>This article has me wondering if all the gamedev things I *didn&#x27;t* read about but are adjacent have utility in this kind of thing. I can&#x27;t be the first person to think a boids router would be pretty fun. More seriously, I bet jumpflooding signed distance fields would provide you a lot of power.<p>Everything about spatial hashing in particular matches my experience. Haven&#x27;t found many occurences in almost 2 decades where any of the tree structures are worth the time. One notable exception. The lovecraftian text editor I made uses quite a lot of trie&#x27;s for reactivity things. Nice way to compress 45,000 words into a compact state machine for event handling.
评论 #43508075 未加载
评论 #43508626 未加载
amiga386大约 2 个月前
&gt; 95% of your focus should be on reducing the number of iterations. This is why language doesn’t matter.<p>And then once you&#x27;ve used the playful, expressive (interpreted, abstract, slow) language you enjoy using, to develop an excellent, performant algorithm... if performance still matters, write the same thing again in a performant, low-level language, and perhaps even write architecture-specific assembly.<p>There&#x27;s a reason numpy, pandas, OpenCV, TensorFlow aren&#x27;t written in pure Python, but instead let Python tell them to do things they&#x27;ve implemented in high performance C++&#x2F;assembly&#x2F;CUDA, etc.<p>No matter how proud the authors would be of exploring a problem space and coming up with an efficient algorithm (and blogging about it), I doubt they&#x27;d be popular numerical computing libraries if they insisted on it being written in pure Python, or Javascript.<p>While this is a fun blog post, I don&#x27;t think it&#x27;d have the same takeaways if the author&#x27;s algorithmic insights got a pure-Javascript HEVC encoder down from 1 day per frame to 3 hours per frame...
knodi123大约 2 个月前
Man, look at all those keywords I remember from college. I wish I got to use fancy well-known algorithms. Instead all I&#x27;m doing is building UI components and REST APIs to present elasticsearch results. All the fun stuff is buried in black boxes.
评论 #43500786 未加载
评论 #43502418 未加载
nine_k大约 2 个月前
This is great. As someone not working directly on 2D &#x2F; 3D space problems, my biggest take-away is the value of visualizing things. Humans are really good at grasping and analyzing pictures. Another is the idea to use a stochastic or brute-force method to understand the shape of the problem, so to say, and choose a better method based on that, not from a theoretic understanding alone.
aranchelk大约 2 个月前
&gt; 2. Implementation Language doesn’t matter<p>&gt; I’m controversially writing our autorouter in Javascript. This is the first thing people call out, but it’s not as unreasonable as you might expect. Consider that when optimizing an algorithm, you’re basically looking at improving two things:<p>&gt; Lowering the number of iterations required (make the algorithm smart) Increasing the speed of each iteration<p>It may be true in this domain, I wouldn’t know, but applied to software engineering in general IMO it would be a massively incorrect assumption to say choice of language doesn’t affect speed and needed number of iterations.
评论 #43502143 未加载
评论 #43503857 未加载
kayson大约 2 个月前
I want to love hardware as code. I really do. I love infrastructure as code, devops as codezyou nake it. But I just don&#x27;t think it&#x27;s ever going to happen. At least not fully. Something about it to me just has to be graphical. Maybe it&#x27;s the information density, or the fact that circuits are graphs &#x2F; networks, or maybe it&#x27;s just habit.<p>On the topic of autorouters, the post doesn&#x27;t really go into why there are no open source data sets and why there aren&#x27;t many open source tools. It&#x27;s probably no surprise but there&#x27;s a TON of money in it. The author mentions iphones and 10s of thousands of routes. That&#x27;s nothing. Modern ICs have billions of transistors and billions of routes with an insanely complicated rule set governing pitch, spacing, jobs, etc. Not to mention the entire time you have to make sure the parasitic resistance and capacitance from the routing doesn&#x27;t break the timing assumptions.<p>Cadence and Synopsys probably put billions yearly into R&amp;D and I bet a big chunk goes into &quot;Place &amp; Route&quot;. I&#x27;ve heard that licenses for their tools run into the miions of dollars per head per year.
评论 #43504415 未加载
shadowgovt大约 2 个月前
I love this article. Two things I&#x27;d consider highlighting:<p>1. Autrouting in particular is a problem well-suited to visualization and not all problems are. it&#x27;s fundamentally about real things in real space (bonus: they&#x27;re <i>mostly</i> constrained to a 2D plane, which makes them easy to visualize on a computer screen). A lot of hard and interesting problems don&#x27;t match that reality and so aren&#x27;t as amenable to visualization.<p>(... but the general advice, &quot;look for opportunities to visualize,&quot; stands. Your eyes and brain are <i>very</i> fast matchers for a broad variety of patterns in a way a computer isn&#x27;t without a lot of special-purpose, tuned software).<p>2. JavaScript, between the language itself (specifically the ability to reflect data structures at runtime) and the ecosystem around it, is very amenable to visualization. In that way specifically, it was a strong choice for this problem domain. Imagine how much work you&#x27;d be taking on if you decided to &quot;just bang out a quick visualization&quot; for an arbitrary piece of the algorithm in C++, or Rust.
CamouflagedKiwi大约 2 个月前
The third point - &quot;Spatial Hash Indexing &gt; Tree Data Structures&quot; - is probably great in this domain, but shouldn&#x27;t necessarily be taken as global truth. I&#x27;ve optimised a system significantly before by going from a grid to a tree - because if your points are significantly unevenly distributed then you effectively have a bad hash function, and it devolves to O(n) performance.
评论 #43507556 未加载
phendrenad2大约 2 个月前
I wonder how autorouters encode all of the various electronics rules. Such as min distance between traces, max angle of a turn, how to snap multiple connections together so they look good, etc.
评论 #43501339 未加载
Lerc大约 2 个月前
I am a strong proponent of visualisations. I also have a tendency to write things in JavaScript that others might choose a different language. I&#x27;m now wondering if those things are related. Having the browser to provide an interface can make that a lot easier. Recently I have been doing a fair bit of transformer and NNet stuff so consequently Python. I have found it a bit of a step back when it comes to visualisations. It&#x27;s easy to used canned techniques to plot data, but not as easy to knock up a custom interactive visualisation.<p>Hmm, I wonder what python raylib is like, that might be the ticket.
评论 #43503822 未加载
评论 #43503043 未加载
评论 #43502073 未加载
bArray大约 2 个月前
Does anybody have materials regarding how you would go about writing an autorouter? I was thinking to maybe use something like this [0] as a starting point?<p>I have a few major nags about current autorouters:<p>1. No way to prioritise connections.<p>2. Handling of differential pairs or buses is terrible.<p>3. Does not use best practices for high-speed signal lines.<p>4. No way to add arbitrary rules to the autorouting process, i.e. block a trace from going through an area. For example, maybe you don&#x27;t want a power trace being autorouted under your IMU, but some low voltage signals are fine.<p>I&#x27;ve use freerouting [1] in the past but it has a somewhat difficult time of being maintained. Freerouting seems to really struggle with larger designs, it seems to be greedily routing traces and spends ages trying to fix those early placed traces.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;vygr&#x2F;Python-PCB" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vygr&#x2F;Python-PCB</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;freerouting&#x2F;freerouting" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;freerouting&#x2F;freerouting</a>
hyperbrainer大约 2 个月前
&gt; &gt; A recursive algorithm is a depth first search. Any loop that explores candidates&#x2F;neighbors without sorting the candidates is a BFS.<p>BFS is also a recursive search. Even in the case of non-recursive search, the only difference is whether you use a queue or stack.<p>Apart from that, great article.
评论 #43503990 未加载
kalaksi大约 2 个月前
&gt; 2. Implementation Language doesn’t matter<p>I&#x27;m not sure how performant modern day JS is but aren&#x27;t you still leaving a lot of performance improvements on the table? Sure, algorithm may matter more but who says you can&#x27;t use the same algorithm.
teleforce大约 1 个月前
&gt;I believe that solving autorouting will be a massive unlock for physical-world innovation and is a key piece to enable the “vibe-building” of electronics.<p>I strongly believe that the CAD world including EDA is at the verge of disruption by an AI or more correctly Machine Intelligence (Constraint Programming - CP to be exact) very similar to how LLM disrupting the Chatbot technology [1],[2].<p>The path to this is most probably by solving the autorouting mechanism with CP, a deterministic logic, optimization and constraint programming machine based intelligence [3], [4], [5],[6].<p>Fun facts, the modern founder of logic, optimization, and constraint programming is George Boole, the grandfather of Geoffrey Everest Hinton, the &quot;Godfather of AI&quot; and &quot;Godfather of Deep Learning&quot;.<p>[1] Most AI value will come from broad automation, not from R &amp; D (313 comments):<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43447616">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43447616</a><p>[2] Diagrams AI can, and cannot, generate (68 comments):<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43398434">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43398434</a><p>[3] Constraint programming:<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Constraint_programming" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Constraint_programming</a><p>[4] Logic, Optimization, and Constraint Programming: A Fruitful Collaboration - John Hooker - CMU (2023) [video]:<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;live&#x2F;TknN8fCQvRk" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;live&#x2F;TknN8fCQvRk</a><p>[5] &quot;We Really Don&#x27;t Know How to Compute!&quot; - Gerald Sussman - MIT (2011) [video]:<p><a href="https:&#x2F;&#x2F;youtube.com&#x2F;watch?v=HB5TrK7A4pI" rel="nofollow">https:&#x2F;&#x2F;youtube.com&#x2F;watch?v=HB5TrK7A4pI</a><p>[6] High-Quality Ultra-Compact Grid Layout of Grouped Networks [PDF]:<p><a href="https:&#x2F;&#x2F;ialab.it.monash.edu&#x2F;~dwyer&#x2F;papers&#x2F;gridlayout2015.pdf" rel="nofollow">https:&#x2F;&#x2F;ialab.it.monash.edu&#x2F;~dwyer&#x2F;papers&#x2F;gridlayout2015.pdf</a>
djmips大约 2 个月前
This blog post sings to me. Well done. I remember the time a colleague effectively used A* as the optimizer for the AI&#x27;s plans in 2 player game. Indeed it really can be purposed for a lot of different things!
xg15大约 2 个月前
I want to thank this guy for the &quot;avoid Monte Carlo&quot; point and the big &quot;no randomness&quot; image.<p>I feel people are getting way to comfortable throwing randomness at things, pretending it&#x27;s perfectly fine or even beneficial because you can reason over the probability distributions and then shrugging their shoulders when the results have unpredictable and impossible to debug edge case behavior.<p>We already have enough unpredictable factors in a program, I feel we don&#x27;t have to purposefully add even more of them.
评论 #43506503 未加载
tobyhinloopen大约 2 个月前
If you&#x27;re navigating on a 2D grid, Jump Point Search &quot;Plus&quot; can be extremely fast:<p><a href="https:&#x2F;&#x2F;www.gameaipro.com&#x2F;GameAIPro2&#x2F;GameAIPro2_Chapter14_JPS_Plus_An_Extreme_A_Star_Speed_Optimization_for_Static_Uniform_Cost_Grids.pdf" rel="nofollow">https:&#x2F;&#x2F;www.gameaipro.com&#x2F;GameAIPro2&#x2F;GameAIPro2_Chapter14_JP...</a>
fooblaster大约 2 个月前
I find it very amusing how essentially all digital vlsi has been autorouted for years, but no one can seemingly solve the board level PCB autorouting problem. I get that one is digital, and the other can be essentially anything, but the difference in practice is a strange juxtaposition.
swayvil大约 2 个月前
Don&#x27;t diss monte carlo.<p>10000000000 random guesses can be way faster than a clever calculation.<p>And maybe there is no clever calculation.
评论 #43504685 未加载
weinzierl大约 2 个月前
<i>&quot;Know A* like the back of your hand, use it everywhere&quot;</i><p>Are state-of-the-art autorouters still based on A*?<p>From what I remember A* was used in the 80s before Specctra introduced a cost based push and shove capable approach in the mid 90s.<p>A* being what it is, is probably still a part of contemporary solutions, but I am surprised about the emphasis it got in the post.*
thenthenthen大约 2 个月前
Looking forward! Feature request: would it be possible to add obfuscation? This is not a solution to my issue ( it is more social), but could be… interesting
sitkack大约 2 个月前
What a wonderfully written post! Much respect.
jofla_net大约 2 个月前
Wish i had read #3 a few years ago before doing one of those &#x27;interview&#x27; &#x27;projects&#x27;.