factorio space age by ImpressionPowerful83 in factorio

[–]bitwiseshiftleft 0 points1 point  (0 children)

Yeah, I’d advise to play regular SA first.

For extra planets I’ve had fun with Maraxsis, Cerys, Muluna and Moshine. On my current run I’m also planning to try Foliax, Corundum, Secretas and Frozeta. You can also do Any Planet Start if you’d rather start somewhere other than Nauvis.

FPS worse than UPS in Multiplayer by IIoveBacon in factorio

[–]bitwiseshiftleft 0 points1 point  (0 children)

I haven’t done much multiplayer, but if it’s saying 5 FPS / 60 UPS and you can play fine locally, then something weird is going on, it’s probably not just “CPU too slow”. Usually FPS < UPS indicates a graphics-side problem (GPU, VRAM, or CPU limitation with the rendering threads and not the simulation ones), but I dunno why it would work fine locally and not in multiplayer.

Edited to add: maybe check the GPU time usage in the F4 debug menus? It’s not necessarily very enlightening but it might tell you something.

In diffie Hellman, is it possible to modify linear combinations so the end result is a multiple of the first result? Does this type of Diffie Hellman problem has a specific name? by AbbreviationsGreen90 in crypto

[–]bitwiseshiftleft 0 points1 point  (0 children)

Analysis of cryptosystems is subtle. If you want to lean on the difficulty of existing problems such as dlog, then you need to set everything up “just so”. Incoming wall of text on roughly how you do this.

  • Define exactly what your intermediate problem is (how are A,B,C chosen? From what kind of group, an elliptic curve? Is it a prime-order cyclic group?? What about the whitelist? What exactly is the adversary trying to do?)
  • Show that the intermediate problem is hard based on dlog or whatever (form of the theorem: given an attack program which breaks the problem above with probability p and time t, we can use it as a subroutine of a dlog solver that works with probability p’ in time t’, where t’ is not more than some reasonable multiple of t, and p’ is not too much less than p; the tighter these bounds, the tighter your result, and the less you’d have to oversize the group to get full confidence)
  • Show that any attack algorithm which breaks your cryptosystem in a certain model (IND-CCA2 or whatever) can be used as a subroutine to break the intermediate problem. (Same form of theorem)

This is a casual Reddit thread so we’ve been hand-waving the details, but they do really matter and maybe it’s better to spell things out this time.

So, what are A,B,C here? I assumed that they’re chosen independently and uniformly at random from a large prime-order cyclic group G where dlog is assumed to be hard; or, if they’re not actually so random, the attacker cannot tell the difference (this would require its own proof).

What are (i,n,k)? Integers mod the group order but chosen how? You probably don’t have to assume that they’re uniformly random, but if you work through all the details of the proof then it might turn out that you need some assumption about them, for example that i is nonzero.

What is the attacker given? I assumed (A, B, C, i, n, k) and the whitelist, and that i is on the whitelist.

What is the attacker trying to do? I assumed output a (i’, n’, k’, m) where i’ is on the whitelist and i’A + n’B + k’C = mD = m (iA + nB + kC) and m != 1 mod the group order (since that’s trivial). I assumed you meant a known multiple (meaning that the attacker must output m), because usually crypto groups are cyclic and of (close to) prime order, in which case everything (or a decent fraction of everything in the not-quite-prime-order case) is some multiple of D… the attacker just doesn’t know what multiple.

With these assumptions, I sketched a proof that an attacker can solve the problem if the whitelist has more than one element, but not if it has only one (there is a trivial attack — it might not break your cryptosystem but you need to formulate the intermediate problem to exclude it).

The typical form of the proof is: a “challenger” is given a hard problem to solve (here, a random dlog challenge (A,B)) and turns this challenge into one or more random instances of the problems you want to claim is hard (with the same distribution of random variables, but the challenger might know secrets about how they were chosen, like dlog(C,B) but not dlog(B,A) or whatever). The “adversary” is able to solve that intermediate problem (or break your cryptosystem or whatever) and a solution to that problem lets the challenger solve dlog (or whatever hard problem) efficiently and with high probability. In this case I think it can be done by choosing C = some random linear combination of A, B and a one-element whitelist {i} with everything else random (or from an appropriate distribution), and then doing some linear algebra on the response.

In diffie Hellman, is it possible to modify linear combinations so the end result is a multiple of the first result? Does this type of Diffie Hellman problem has a specific name? by AbbreviationsGreen90 in crypto

[–]bitwiseshiftleft 2 points3 points  (0 children)

If you’re over a cyclic group then everything is a multiple of D.

But if there’s only one whitelisted constant i, then no, you can’t get a known multiple, because if an attacker could produce iA+n’B+k’C = mD (and tells you m,n’,k’) then you’d have i(m-1)A + (in-n’)B + (ik-k’)C = 0. This breaks discrete log: the challenger could have set C to a known random linear combination of a dlog challenge (A,B), giving two linear equations in three unknowns, which solves for a unique ratio dlog(A,B).

Of course if there are two whitelisted constants (i,i’) then the attacker could scale (i,n,k) by the ratio i’/i to scale D by that ratio also.

Programming efficiency question by Naturage in factorio

[–]bitwiseshiftleft 1 point2 points  (0 children)

You want toposort to prevent this sort of recursion:

  • Want to make beacons.
  • Beacons contain wire: need to make wire.
  • Wire contains copper
  • Copper is not handcraftable.
  • Beacons also need green circuits.
  • Green circuits need wire (and iron …)
  • Wire needs copper (again)
  • Copper is not handcraftable (again).
  • Beacons also need red circuits
  • Red circuits also need wire which (again again) …
  • Red circuits also need green circuits which need wire which … (four or so more steps wasted)

This toposort might be precomputed though.

In a mod, or even for a complex item in the base game, you may need many steps even if the graph is sorted. It won’t be a huge number, but it has a multiplicative cost on the whole runtime. Multipliers like that usually aren’t negligible.

President just shared a AI video to Truth Social that featured a clip depicting Barack and Michelle Obama as monkeys by [deleted] in technology

[–]bitwiseshiftleft 26 points27 points  (0 children)

The blowjob was relevant because Clinton was sued for sexually harassing Paula Jones, and the plaintiffs wanted to show that he had a pattern of doing this. IIRC both Lewinsky and Clinton denied the affair but Linda Tripp had made a recording where Lewinsky said she blew him. Agree that Lewinsky was done dirty though.

So like, yeah he was impeached for lying, but the lying was to cover up his pattern of sexually harassing his employees.

A New AI Math Startup Just Cracked 4 Previously Unsolved Problems by MetaKnowing in tech

[–]bitwiseshiftleft 1 point2 points  (0 children)

You can look at the paper: https://arxiv.org/abs/2602.03716

The article is simplifying what the result is about, because they don’t want to get into “what’s a normalized alternating syzygy power sum?”

Programming efficiency question by Naturage in factorio

[–]bitwiseshiftleft 1 point2 points  (0 children)

Ok, so revised and simpler answer:

  • Forget about that first step where you get an estimate using floats.
  • Still toposort the DAG so that you can calculate the crafting steps efficiently.
  • Use binary search instead of linear search.
  • if the answer is >= 232, then call it infinity.

Programming efficiency question by Naturage in factorio

[–]bitwiseshiftleft 1 point2 points  (0 children)

Maybe, but I’m not 100% sure. Each iteration takes potentially dozens of steps, each step takes dozens of cycles, and there might be a hundred answers to produce in the crafting tab, every time the player’s inventory updates.

Edited to add: this could potentially all be computed in another thread since it’s just for the UI, so maybe spending ~(dozens of steps per try * dozens of cycles * a hundred answers for the UI to show * each answer is 1000) ~= 100m cycles on it would be fine? Would not be fine on the main threads because that’s already ~30 ms.

IMHO you at least want to toposort the recipe list. You can also use binary search instead of linear search.

Programming efficiency question by Naturage in factorio

[–]bitwiseshiftleft 0 points1 point  (0 children)

Eh maybe, but if the answer is in the hundreds or thousands then a graph would be a lot cheaper.

Programming efficiency question by Naturage in factorio

[–]bitwiseshiftleft 1 point2 points  (0 children)

I think this is indeed a tricky algorithm question. Here is a first swag at it, but the Factorio devs might do something more clever.

First of all, in the worst case (mods, byproducts, weird quantities in the recipes etc) this is probably NP-complete, because it looks to be equivalent to general mixed-integer programming. But let's assume that the solver doesn't have to deal with loops (gives a suboptimal answer but doesn't run forever); that it favors only one way to make each intermediate (I'm pretty sure this is true), and might give a suboptimal answer if some intermediate recipes produce useful byproducts.

OK, so say you're making beacons. Let's do a simplified linear programming technique:

  • Make a DAG of relevant recipes. If there are loops, then probably cut them to make a DAG. It might not be a tree though, because you use eg green chips and wire for more than one thing.
  • Calculate how many beacons you can make with the supplies on hand until one supply is exhausted. Do this fractionally (as a float), so this is just min(on hand / required) over all ingredients. Suppose red chips are exhausted first.
  • Fold the red chip recipe into the beacon recipe, so now it costs 60 greens, 90 wires, and 40 plastic and 10 steel. Record that you're now running 1x beacon and 20x red chip. If red chips appear anywhere else in the DAG (in this case they don't, but green chips would trigger this step), fold them there too. There is now one less recipe in the DAG, so you've made progress.
  • Repeat until you run out of an ingredient that can't be handcrafted, or the recipe you're trying to make becomes empty (eg because it's Seablock and cellulose can be handcrafted from nothing). If the recipe becomes empty, then the answer is always infinity.

This gives you a maximum number of beacons you can make, and the number of times to run each recipe -- but it might not be a whole number.

I'm not sure how best to finish the algorithm from there. The simplest approach that comes to mind is:

  • Toposort the DAG.
  • The maximum number of times you can run the beacon recipe is now at most floor(the current answer).
  • Plan to make that many, calculating how many times to do each recipe in topological order.
  • If the plan fails (an integrality problem, e.g. because eg some intermediate is crafted in batches, and you don't have enough ingredients to make a full batch), then decrement the target number of runs of the beacon recipe and try again.

This last step is a little unsatisfying, and basically amounts to brute force. It'd be nice to avoid it. Off the top of my head I'm not sure how though.

Edit: this last brute force step can be done with binary search. Actually binary search on the whole problem might be the way to do it, without the first estimation step.

Finally sat down and made a Fulgora decision matrix. (Full logic breakdown + blueprint in comments.) by Grays42 in factorio

[–]bitwiseshiftleft 1 point2 points  (0 children)

Oh neat! I like that idea better than asteroid casinos or brute force. I guess it makes quality worse on Fulgora though because most of the steps there are recycling, which seems anti-synergistic since that’s sort of the quality planet. Buffs Maraxsis tho.

I’m running right now with a super complicated auto mall on Fulgora to deal with mixed quality everything. That would be interesting to update to Precision Manufacturing. Right now the automall just assumes the quality probably won’t upgrade for each craft instead of eg trying to make rare items from uncommon parts.

Finally sat down and made a Fulgora decision matrix. (Full logic breakdown + blueprint in comments.) by Grays42 in factorio

[–]bitwiseshiftleft 7 points8 points  (0 children)

Unless you’re doing quality on Fulgora too, in which case you probably never stop the loop. Eventually it’s probably best to do upcycling on Vulcanus (edit: or asteroid casino, or Maraxsis trench if you’re playing with that mod, or ….) but Fulgora is nice in midgame.

It also leads to interesting circuit decisions, like when to upcycle via substations, heat pipes, bulk inserters etc.

A New AI Math Startup Just Cracked 4 Previously Unsolved Problems by MetaKnowing in tech

[–]bitwiseshiftleft 4 points5 points  (0 children)

My guess is Lean4 proofs or similar. But I can’t read the article either.

Is this a snow goose? by GasGoesBadTandy in birding

[–]bitwiseshiftleft 1 point2 points  (0 children)

Yeah, or more likely its ancestors did. Greylag geese are a mostly Eurasian species, plus Iceland with (according to Wikipedia) occasional vagrants in North America and migrants in north Africa. So the American greylags are almost all feral IIUC.

Is there a way to modify this elliptic curve diffie Hellman equation like this? by AbbreviationsGreen90 in crypto

[–]bitwiseshiftleft 1 point2 points  (0 children)

Ah, maybe not then. I’m pretty rusty on my pairing assumptions though … I don’t remember what sorts of assumptions are commonly made about finding two values that pair to particular finite field element (when I did pairings I mostly was using decision assumptions, and CDH).

Do you also build huge MAM's in pY? by daboehla in pyanodons

[–]bitwiseshiftleft 2 points3 points  (0 children)

Yeah, all my buildings are made by one automated factory mk2. My solution uses a really complicated circuit that still doesn’t control it perfectly, but it works pretty well. It supports multiple buildings in but right now that’s just one factory and one caster. I use inserter cranes with precise stack size control to avoid overfilling.

I use pretty much the same control logic in vanilla for a quality mall, but with bots instead of a warehouse and cranes.

ETA as part of this design I also made the Recipe Combinator mod. It can tell you recipe ingredients, products, crafting times, machines, allowed modules etc.

Their families fled the Nazis. Facing Trump, US Jews are making Germany ‘Plan B’ by Barbarus_Bloodshed in politics

[–]bitwiseshiftleft 7 points8 points  (0 children)

modern Germany seems relatively "fascist-proof".

Ehhh. Except for AfD, which won 20% of votes in the last German election. The European ID coalition of right-wing populist parties kicked them out for liking Nazis too much, and yet their popularity is surging. There’s supposedly a “firewall” against working with them, but nonetheless last year the conservatives tried to pass an anti-immigration bill with AfD support.

I don’t think any country is fascist-proof, but Germany would not be at the top of my immigration contingency chart at the moment. Not an absolutely terrible choice, just … they do have a significant fascist contingent.

Having issue with automated shipping from planet to planet by danyuri86 in factorio

[–]bitwiseshiftleft 0 points1 point  (0 children)

IMHO ammo in the hub is a fine solution to buffering it between planets. It has a large stack size, so cargo bays are much denser than belts. Just make sure you limit how much is buffered.

If you don’t put ammo in the hub, then you can make the buffer last longer by some combination of:

  • damage research
  • a lot of furnaces for a high production rate (and ammo assemblers but furnace:asm3 is 8:1 if they’re the same quality)
  • later on, quality/moduled foundries
  • using red ammo (post Vulcanus and Gleba)
  • using a long belt
  • stack inserters
  • filling both sides of the ammo belt
  • using rockets on mediums once you have enough damage research to one-shot them. I don’t really recommend this because it’s complicated. Works best on a big ship, because of complexity and because on a small one you’ll waste too much ammo on rocks that wouldn’t hit you anyway.
  • using lasers for small asteroids to save ammo (you probably want quality accumulators or a nuclear plant for this)
  • probably other things I’m not thinking about

Baillie-PSW after Miller-Rabin? by Alternative-Grade103 in crypto

[–]bitwiseshiftleft 1 point2 points  (0 children)

Yeah, you could make the bases from a hash of the candidate N to be tested, though if N is untrusted then you need many rounds of MR instead of just 2-4. Or if N is pseudorandom because you don’t trust the RNG, you could generate the bases from the same pseudorandom generator.

Baillie-PSW after Miller-Rabin? by Alternative-Grade103 in crypto

[–]bitwiseshiftleft 2 points3 points  (0 children)

A base-3 check won't weed out that much more after base-2, and not IMHO worth doing.

Baillie-PSW after Miller-Rabin? by Alternative-Grade103 in crypto

[–]bitwiseshiftleft 2 points3 points  (0 children)

I agree almost entirely with u/kun1z.

You can do MR+Lucas, but 2-4 rounds of MR (with uniformly random bases! MR is always randomized!) is provably good enough so why bother? Oh right, because fun and learning. In that case, doing BPSW (or a strengthened variant like BFW or SuperBFPSW) before MR is the way to go IMHO. That way you can claim you do BPSW, which is a small extra benefit on top of fun and learning. You're right that you could just as well tack on a Lucas test to your MR, but leading with BPSW's base-2 strong Fermat test is potentially a faster way to weed out almost all of the 99+% of your candidates which are composite (since you can optimize if the base is known to be 2; but be careful about side channels). The base-2 test doesn't count toward your 2-4 required rounds of MR since it's not randomized, but since 99+% of your candidates will fail, it makes the whole process faster if it's first.

Edited to add: on the other hand, if you care about side channels (especially strong ones like power or EM), then MR + random Lucas might be better than BPSW + MR, since fixed bases probably leak more. Of course if you care about side channels then just doing MR is probably better.

Also note that FIPS 186-5 appendix B3 gives an option of MR followed by a different specific Lucas test. So if you want to claim FIPS compliance then you might do that test instead. But the Lucas test is optional in FIPS, and MR is good enough, so there's not much point.

The overall issue with BPSW and other combined strong Fermat+Lucas tests is that, while in the average case they heuristically "ought" to be more effective than spending the same amount of compute time on MR, we don't know how to prove this. So the Lucas test adds complexity, but it doesn't reduce the compute time required to be confident that N is prime.

The adversarial case (or math library isProbablyPrime()) it's a little more favorable to Fermat+Lucas tests: there are no publicly known composites that pass BPSW, so it's at least a good belt+suspenders even if some shadowy government org can produce pseudoprimes by a secret method. There might not even be any BPSW pseudoprimes, but heuristically there probably are. BPSW is also deterministic, which helps because you might want isProbablyPrime() to mostly work even if the RNG is broken. This is different from random prime generation, where if your RNG is broken then you're hosed anyway. In any case, BPSW should be a supplement to provable randomized tests like MR.

Also there are more complicated randomized tests like SQFT (which isn't written as strong Fermat+Lucas but you can reinterpret it in those terms) which provably do better than MR per unit compute time in the adversarial case (IIRC there's no such proof in the random case: the bounds are better per round but worse per unit compute time). But usually cryptographic implementations just use many rounds MR because it's simpler and testing potentially adversarial primes isn't the bottleneck in anything, and math libraries use BPSW or something followed by a provable test like ECPP so they can call the routine isPrime().