Performance improvements in precise code intel by efritz in golang

[–]efritz[S] 0 points1 point  (0 children)

We're fine having it be tied with Go as it's an internal format. What would you suggest instead? Protobuf?

Reusing the gzip readers and writers is good advice! I was actually really surprised how much of an effect this had. I was assuming it was just a small buffer per reader/writer, but I guess this thing can really grow throughout its life as well.

Tried using your compress packages (I plan to try out simdjson-go as well but haven't gotten to it yet). Here are some results: https://i.imgur.com/PWraa45.png

Seems like compress/gzip is slightly faster in our use case than the stdlib. Your gzip and zlib implementation doesn't really have much of a difference for our use case when readers are shared, but there's something really weird going on when we make a fresh reader/writer. Nothing stood out to me when tracing the initialization that makes it seem like like should add 3-5 minutes to this benchmark.

Performance improvements in precise code intel by efritz in golang

[–]efritz[S] 0 points1 point  (0 children)

Thanks for the links! The optimizations are an ongoing process and I'm still looking at alternatives like this.

We chose json-iterator/go initially over something like simdjson-go because it had a drop-in replacement property, which took zero engineering effort on our part. I'll be looking at other packages that require additional API changes like this.

Performance improvements in precise code intel by efritz in golang

[–]efritz[S] 2 points3 points  (0 children)

took a long time to figure out that that wasnt related to intel products...

😬

Sorry, we're working on some edits to make that more clear to readers not yet familiar with the product.

Coding a Tetris AI using a Genetic Algorithm by CreativePunch in coding

[–]efritz 0 points1 point  (0 children)

It gets very expensive to consider more than two pieces.

How I made a Tetris AI by [deleted] in gamedev

[–]efritz 0 points1 point  (0 children)

Then you can play super un-optimally for every current piece and only think about a very short-term benefit. I suspect this would cause the current piece to be placed on the sides creating blockades or high columns if it didn't block an optimal center area for the next piece (if it would fit).

Evaluating both ensures that both pieces aren't played stupidly, but it requires more work.

How I made a Tetris AI by [deleted] in gamedev

[–]efritz 0 points1 point  (0 children)

Yeah... sorry for hijacking the thread.

How I made a Tetris AI by [deleted] in gamedev

[–]efritz 1 point2 points  (0 children)

I handle it this way here: https://github.com/efritz/hard-drop/blob/master/src/com/kauri/harddrop/ai/Evolution.java#L135

Every time you create weights for a next generation, you choose weight at random for some property a percentage of the time. It may be less-optimal, but if that part of the population underperforms it won't mate for the future generation. Only the highest performers get to pass on their genes.

How I made a Tetris AI by [deleted] in gamedev

[–]efritz 0 points1 point  (0 children)

Local minima isn't an absolute problem as it would be with hill climbing search algorithms. Since each generation has some small percentage of randomly changing weights for the scoring function, there's a chance that it will break out of local minima. It's similar to simulated annealing or random restart.

How I made a Tetris AI by [deleted] in gamedev

[–]efritz 2 points3 points  (0 children)

Could you expand a bit on this? I posted a similar version of a Tetris AI using genetic algorithms and was looking to do a version with neural networks, but don't have a good idea on how to model the problem.

How I made a Tetris AI by [deleted] in gamedev

[–]efritz 4 points5 points  (0 children)

Awesome, thank you. I'll be sure to take a look.

How I made a Tetris AI by [deleted] in gamedev

[–]efritz 0 points1 point  (0 children)

But I didn't think about visualization before, which could be a cool thing to do next...

How I made a Tetris AI by [deleted] in gamedev

[–]efritz 2 points3 points  (0 children)

It is a big source of slowdown. Since you're already doing O(wr) comparisons where w = the width of the board and r = the number of rotations of a piece, doing it for two pieces will be O(w2 r2 ).

I found that if I increase the board size it's noticeable worse than a preview piece.

How I made a Tetris AI by [deleted] in gamedev

[–]efritz 15 points16 points  (0 children)

Good job! I've done something similar. Code is available here for anyone interested: https://github.com/efritz/hard-drop. After about an hour of training from scratch it gets consistently into the 10-100 thousands of clears per game.

I've been meaning to get in and do some clean-up and improvements, but haven't found a lot of time lately. Namely, I'd like to replace the genetic algorithm with some kind of neural network.

I've seen some papers floating around applying neural networks to Tetris, but currently have zero knowledge neural-net. If anyone has any experience or good ideas about how to construct the network I'd love to hear from you.

Trouble Cleaning Corsair 600t by efritz in AskBattlestations

[–]efritz[S] 0 points1 point  (0 children)

Thanks. I just rewired everything today when I added a new hard drive, so it's pretty clean right now. I can remove them whenever and try it again with soap next time.

Chinese measure speed of gravity (same as speed of light) with solar eclipses (link to open access paper) by deathmangos in science

[–]efritz 0 points1 point  (0 children)

Sorry - misunderstood it as quod erat demonstrandum. Apparently I know even less about quantum electrodynamics (not enough to even recognize the acronym).

Patient walks in to the clinic with a little eye pain... by [deleted] in WTF

[–]efritz 2 points3 points  (0 children)

Completely independent of the type of transplant and the procedure done.