Rusty Cogs, One Big Machine

It's Me, The Google Sucker Of Code

While browsing through the Web, I found the Rust Discord Server Where The Cool Kids Hang Out and found some pearls in the chat history:

lol which fortunate T-compiler person is willing to mentor the run-make test RiiR GSoC project - Jieyou Xu

You, apparently!

the poor GSoC candidate does not know what evil lies ahead of them - Jieyou Xu

I am only beginning to realize.

Hello, it's me, the sucker who was roped into this - Oneirical (me)

Welcome sucker esteemed person! - Jubilee

i like how we keep discovering new cursedness and WTF moments in test suites - Jieyou Xu

Hm, the production of WTFs per minute has just started becoming noticeable. In fact, to find this exact quote, I searched "WTF by:(Jieyou's username)" and found exactly 72 matches, with almost every single one tied to some horribly cursed Bash command hack. The point where I truly scored my foothold in the WTF manufactory economy was likely in this specific moment:

ifneq (,$(findstring x86,$(TARGET)))

findstring returns $(TARGET) (non-empty) if it contains the substring x86 or an empty string otherwise, so checking that findstring does not return an empty string checks that target contains the substring... - Jieyou Xu

I beg your pardon? This is actually a great explanation... once you read it 5 times or so.

This is really making me want to compile some of the biggest WTF moments throughout this project and build a little "run-make House of Horror" to spook and scare Rust enjoyers. I already have an excellent introductory addition, with no doubt more to come. I'm pretty sure I noticed a sleep 1 getting changed into a sleep 2 somewhere for the sole purpose of securing compatibility with the FreeBSD operating system...

Anyhow, this week was marked with the first line of code committed to the Rust repository during the summer, with more to accompany it:

Merged

Open

That's a bucketload of pull requests... which did not go unnoticed. Dialing it down and bundling some tests together should be warranted from now on.

Most of these were quite easy and required adding few helper functions... so I wouldn't get too excited just yet. This project is likely getting extended to some amount of weeks that is bigger than 16.

Reading, Much Harder Than Writing?

I used to get a little intimidated when I finished a 10 lines of code pull request, and see that in the meantime, another GSoC contributor (if you're reading this, hello FractalFir :3) was building their own personal virtual cathedral, stained glass masterpieces included.

I am obviously not as experienced as them, but there's something else at play... the Rust-.NET code generator is practically a solo project, without a code review process, while directly making pull requests to a gigantic established codebase requires not only understanding what has been written by people-who-are-not-you, but also integrating your own work within... ensuring that the aforementioned people-who-are-not-you will be able to make heads and tails of it.

It's the first time I am part of something so massive in the technology field. I've always done solo projects like this where I would dump huge bucketloads of code in my personal repository daily. Going from this to the snail's pace of open source is a true change of paradigm... but one I find so very educational. I already knew "lines of code are not a good metric", but experiencing directly such a striking example really hardens this truth.

It is amusing to think that the Rust-.NET code generator may eventually become one such open source project, with a code review process and integration in software like Unity... Maybe it's going to be a GSoC organization one day.

Hehe, that's a far-fetched thought. Keep building your cathedral, Fractal, you have something very awesome on your hands.

The run-make test rewrites may not be as glamorous as a Whole New Thing, but we all have our part to play in the ecosystem. Each brick we put down is one step closer to higher quality engineering. I am glad to be part of this community :3

Testing My Patience With Tests

The Rusty Sea Scrolls

As I informed them of the shortcomings of my hardware, the Rust Foundation generously granted me access to one of their DevDesktops - powerful remote Linux machines. How trusting of them!

Little do they know, I have installed an comprehensive simulation of the material world on their systems. It's currently in the Pleistocene, and it should result in the invention of a parellel world Rust in 2.6 million years, give or take. Alternate dimension pull requests - the future of open source.

As for the slight bit of computing power I am actually using for my GSoC project, it cuts down the time to ./x check the Rust compiler for the first time from 30 minutes to around 6 minutes! Splendid.

Next, I went for a quick archeological dive through the run-make directory, adding explanatory comments and linking relevant pull requests and issues. Some amusing discoveries include:

  • Many of them were created over a decade ago, by the person who is currently the #2 contributor of all time to Rust. The #1 is a bot who automatically merges accepted pull requests. Mystified by this, I looked up if this was intentional, and found a thoughtful comment:

"Top contributor" is not a place of glory, it should go to a bot because people should work at a sustainable pace and prioritize touching grass every once in a while. If a person ever works harder than bors, that's a problem! -carols10cents

  • In 2017, the grep command utility in run-make tests was replaced by a custom variant, CGREP, scriped in Shell, for the purposes of making debugging easier. However, not everyone was aware of this change, and some additional instances of grep snuck in after that date, such as in the compressed-debuginfo test. Well, good thing there will soon be even more robust support for this command!

  • It is quite interesting to see how Rust contributors were talking about the project in the threads from over a decade ago. Adoption wasn't as widespread, and there is occasional mention of how their changes will need to remain maintainable in multiple years. Well, looks like their foresight was warranted!

Finally, I tried to write a quick script to locate dependencies and Bash commands in each run-make test - a simple set of Regex to find individual words and match them against a list of common Bash utilities. Trying to add "look-behind" in the Regex resulted in an interesting "Rust does not support look-behind!" error, which led me to learn about an interesting piece of Regex lore. How in-character of Rust to curate which features get to be added so carefully...

Not A Contender, Not A Competition

It was a bit anxiety-inducing back in March to submit a project proposal, as it felt like "promising I'll get work done" without actually getting much work done.

While I am over here getting up to speed and reading archives, the 7th place all time top contributor human is immaculately porting some of these tests while acknowledging the subtle ins-and-outs! It's honestly a blessing for me, as I get to read their changes and learn from them.

But, most importantly, it got me to notice something.

For the last 5 days, I have started my first ever internship (that is specifically in the field of technology, I've worked in the biology field before). It's no doubt exactly what the veterans remember of their intern days - antiquated codebases, project managers tracking hours and setting down expectations, daily standup... (They did let me write some Rust for them to rewrite an unstable build script, though!)

Doing the Google Summer of Code at the same time is enlightening. The only deliverables open source contributors have is, at most, finishing what they start to respect the efforts of their code reviewers. An utterly different mindset from academia and industry!

My situation is different, of course, as I have evaluations, engagements to respect, and a schedule of sorts. So, that is what GSoC is. An introduction to open source development, made understandable to the rat-race-brained interns like me.

It's a tough balance to have all these commitments at once. Motivating oneself to go write more code after a day of writing code sounds difficult, but it's made easier by the fact that one of them has that community aspect and the other does't. Truthfully, trudging through all this dusty Python has made me appreciate the Rust Result type to an extent I never previously reached while working on my personal projects.

This weekend, I'll see if I can get some real code placed down and shipped in a pull request to test if I can keep the torch burning. My little archeological dive has identified some lower-hanging fruits which, in appearance, look like a good way to get started.

The goal isn't to rush in when I don't have a full overview of the testing ecosystem, but mostly to see how I fare doing something that resembles the bulk of what work will be like in the coming months.

It's a test. Done on run-make tests.

A test test.