The Stochastic Game

Ramblings of General Geekery

Modern Mercurial

I recently came across Josef Sipek’s series of articles on setting up
a “modern Mercurial”. In the first post, he realizes that he was missing
out
on a lot of the new features that had been added to our beloved hg
along the years, due to the maintainers’ policy of not changing the default CLI
behaviour.

I realized I had the opposite problem – my .hgrc is a loose collection of
snippets I gathered from all around the web, at various times, and as such it
has accumulated several layers of Mercurial history.

Extensions

The main thing to clean up was my list of extensions. I had 14 built-in
extensions enabled, several of which had been deprecated in favour of something
better, or incorporated in the core. Now I’m down to 8:

  • color: self-explanatory… make it pretty.

  • extdiff: lets you specify an external diff/merge tool.

  • histedit: lets you shoot yourself in the foot, a.k.a editing history with
    a workflow similar to git rebase --interactive.

  • pager: lets you specify a custom “pager”, i.e. the thing that stops the
    text from scrolling off the top of the screen, and lets you “paginate”
    a command’s long output, like hg log. This mostly saves you from always
    having to do hg whatever | less or similar.

  • purge: adds a command for removing all untracked files. Useful sometimes to
    clean up temp files, .orig files, etc.

  • rebase: this is a basic operation for DVCSes so go figure why this isn’t
    enabled by default, especially now that we have phases.

  • schemes: super useful for making aliases of hosting providers like Github,
    Bitbucket, and even your own private domains.

  • shelve: I used to use that, along with MQ, to manage my works-in-progress,
    but now that I’m using evolve (see below), I don’t really use it anymore…
    still, I prefer to keep it around.

I also have a few third-party extensions:

  • hg-git: required for mirroring Mercurial repositories to Github.

  • hg-onsub: run a command on all sub-repositories. I don’t use sub-repositories
    much anymore, since I figured they are a pain to work with, but it’s still
    occasionally handy to batch-pull/update sub-repos.

  • hg-allpaths: run hg pushall and push to all paths in one go.

  • evolve: enables the changeset evolution features that are inactive by
    default in the Mercurial core. This is totally awesome, and quite mind-blowing
    sometimes.

  • terse-status: when you have a directory with lots of untracked files and
    nothing else, make hg status show you just the directory… not 3 pages of
    untracked filenames.

Logging

Nothing fancy here, really… I’ve cloned Steve Losh’s templates a long
time ago and never looked back.

Multi-plaform

One cool thing that .hgrc files have is support for including other config
files that may or may not exist, and support for environment variable expansion.

My .hgrc is actually generated by my Dotfilesinstall
script
, but it includes the “real” hgrc (which you can see
here
). At the end, I can include further configuration files, like
a “local” file that could contain secret or temporary stuff, and a platform
specific configuration file:

# OS-specific settings
%include hgrc-${OS}

# Local settings (if any)
%include hgrc-local

That’s how I keep things working between Mac, Linux, and Windows between home
and work.


Effects of CPU Caches

I recently read this post by Nicolas Douillet about CPU caches and performance. I recommend it! Apart from being a nice, fairly easily digestable recap of how CPUs work when it comes to memory, it also taught me the existence of something I totally didn’t know about until now: the Translation Lookaside
Buffer
.

It’s used to cache recently used mappings between physical and virtual memory. I had no idea that this stuff was cached, and that it therefore could have some important effect on performance.


Iron Maiden singer: “CAN I PLAY WITH MADNESS”

My kid: “Yes you can play with magnets. It’s pretty fun.”


Gutentags Gets A Job

So event though I spent most of my long Easter week-end doing random cool stuff, I still got to do some nerdy stuff – namely catching up with bugs and feature requests for Gutentags, which is my most popular open-source project to date.

The main new thing is that Gutentags is now using Vim 8’s job API (job_start() and the like), with a compatibility layer for Neovim’s own, sadly different (but older), job API. This doesn’t make Gutentags any more asynchronous than it was before, since I jumped through hoops to make it work correctly even before, but it does clean up the code in a few places:

  1. No more need for a .lock file that indicates if the background job is running. This means less chance of Gutentags getting “stuck” because the lock file was somehow left behind incorrectly by a previous crash.
  2. No more need for polling the aforementioned lock file… we can just wait for a job to finish.
  3. As a corollary of the previous point, it’s now easy to force-refresh Vim’s status line and get real-time, correct indication of whether Gutentags is running in the background or not. See :help gutentags-status-line for more information on this.

Because I don’t want to support 2 code paths in the same file, the requirements for Gutentags have been bumped to versions of Vim/Neovim that have the job/*jobwait features… if you need to use Gutentags with Vim 7 for some reason, you can stay on the vim7 branch, which may or may not receive some bug
fixes in the future.

You can pull the latest changes from BitBucket or Github depending on which DVCS you prefer. Have fun!


GDC 2018 Recap

So that happened – I went to my second GDC and this time I presented something. Look at how shiny my forehead is!

Big thanks to the Toolsmiths guys (Geoff and David) for organizing a full day summit dedicated to tools programming – a topic that I always thought was lacking a proper worldwide community the same way, say, graphics rendering or animation have. Not only did I have the chance to present my talk as part of that “Tools Tutorial Day”, but I had the honours of being the inaugural talk!

The room was packed the whole day, so you can bet there will be more tools programming shenanigans next year.

Oh, and my talk is now available on the GDC Vault if you have access.

Here are some notable things that happened this year:

  1. These conferences are always a good opportunity to catch up with friends and acquaintances, but this year I got to meet a bunch of really cool new people through all the tools programming talks and roundtables. I’m hoping to run into them again in the future, which means I’m looking forward to next year!
  2. Speaking of roundtables, I went to more of them this year, instead of going to talks. I was just lurking for most of them, however, being somewhat paralyzed by social anxiety and the difficulty of talking about stuff that I didn’t directly work on myself. I’ll have to speak up more next year.
  3. Stephanie Hurlburt inspired a bunch of older devs like me to allocate some time to meet with newbies who might have questions or just want to get to know people in the games industry. I met with 5 people through that Twitter thread and I hope I had some interesting or useful things to say to them. I still have some follow-up to do with a few of them next week.
  4. When you’re a presenter, you’re invited to a lot more parties. I went to more parties in a week than I did in my entire high-school years. I’ll probably go to less parties next time, since I didn’t care for half of them… just like back in high-school, I guess.
  5. There’s always one last edit you can do to your presentation before the big day. I think I got off lucky to have mine on the very first day, on the very first time slot!
  6. I went to a couple events and talks about “black people in gaming”, but I kinda felt out of place – first, I’m only half-black, and second a lot of those things are really about being black in the United States, which is a whole different level from being black in Canada or in France (where the racism and xenophobia is primarily aimed at other groups). Still, I got a hug from Tanya so that was cool.
  7. I got to see Lord British and Blackthorne for real. Their Ultima Online post-mortem was brilliant.
  8. I also got to see a talk about interactive music in games which ended with the presenter picking up a guitar and harmonica to perform one of the songs from his game. I guess I’ll have to find some really awesome gimmick for my next talk.
  9. I went to a talk about the “depiction of war in games” which was pretty interesting. Rolling Stone later picked up one of the presenter’s quotes to make a clickbaity title that got some backlash on Twitter. You should still watch the talk if you can, though, since it made a couple good points about the role of media and entertainment in society.
  10. Speaking of depressing subjects, the amount of human misery you see around San Francisco is staggering. I live in Vancouver, though, where we have the Downtown Eastside which also has a pretty shocking amount of homeless people.
  11. Some people are calling for GDC to be hosted outside of the US, which I would really welcome.
  12. When walking around the conference, the social etiquette is to not make eye contact with someone that might be trying to read your name tag – they will catch you catching them, and then quickly run away, probably scarred for life.
  13. The dress code, however, is pretty convoluted – one thing is certain, however: if you want to spend some time near the indie gaming booths, you need some cool outfit and blue hair.

And that’s it! I took a few days around the long Easter week-end to rest from the trip…

I hope you’re all doing fine too!


A Tale of Three Data Schemas

Next week I’ll be at the Game Developers’ Conference, along with a lot of people from the video game industry, and I’ll be giving my first presentation there, “A Tale of Three Data Schemas”.

I’m starting small for my first GDC contribution by presenting during the “pre-conference” days that half of the attendees skip. This year should be super interesting however since it will be a full day dedicated to the fine art of making game creation tools, courtesy of the fine folks at The Toolsmiths.

The good thing for my nerves is that my presentation ended up being the very first presentation of the very first day – surely when half the audience is low on caffeine and completely jet-lagged, nobody will notice whether I know what I’m talking about or not… and then I’m done for the rest of the week! Yay!