Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YJIT: upstream yjit_backend_ir branch (new backend) #431

Closed
11 tasks done
noahgibbs opened this issue Aug 23, 2022 · 32 comments
Closed
11 tasks done

YJIT: upstream yjit_backend_ir branch (new backend) #431

noahgibbs opened this issue Aug 23, 2022 · 32 comments
Assignees

Comments

@noahgibbs
Copy link

noahgibbs commented Aug 23, 2022

Starting from yjit_backend_ir (currently: d17b53c), I'll create a new branch without merge commits and with some level of commit-squashing. TODO items include:

  • Linearize the commit history, removing merge commits
  • Update that commit history to be relative to a recent CRuby-master commit
  • Squash multi-commit PRs to a single commit
  • For each PR, make sure the Shopify/ruby PR URL is in the commit message (git filter-branch?)
  • Mention that arm64 support is less mature than x86-64 support in yjit.md
  • Determine how much to squash the commit history
  • Doublecheck rebased compiler code - did we include everything we wanted, and exclude everything we wanted?
  • Review test code - did we include/exclude everything correctly? Do we want to reduce test-code changes in the history?
  • Merge/update CI workflows, including cirrus.yml; grab anything useful from test_yjit_new_backend.rb. Remove temp backend tests workflow.
  • Add any final commits that have been pushed to yjit_backend_ir
  • Open a ruby/ruby PR

I'm biasing toward fewer commit-squashes early in the process, since it's easier to squash than un-squash if needed later.

@maximecb maximecb changed the title Merge yjit_backend_ir upstream YJIT: upstream yjit_backend_ir branch (new backend) Aug 23, 2022
@maximecb
Copy link

Sounds good to me 👍 :)

@noahgibbs
Copy link
Author

The noah_backend_rebase branch has now 'replayed' up through commit b9199af. That's about where we start seeing merge commits and other things of interest that need to be handled more carefully. It's also the earlier history of the new backend, where a lot of the commits don't seem to be part of any PR -- they were just pushed to the branch. As yet I haven't squashed basically anything that isn't part of a PR, so presumably it'll all be compressed a bit later.

I've also made sure the PR commits have their PR number in the first line, so we can easily assess which are in-PR versus non-PR commits with "git log --online".

And now, time to replay more history. I'll continue to push to noah_backend_rebase as I go along.

@maximecb
Copy link

I just updated yjit.md on the yjit_backend_ir branch. I see that we already mention that YJIT is experimental, so I don't necessarily think we need to say that arm support is experimental.

@YurySolovyov
Copy link

Did anything changed about Code GC?

@maximecb
Copy link

Did anything changed about Code GC?

We will resume work on code GC in September.

@k0kubun
Copy link
Member

k0kubun commented Aug 24, 2022

FYI: I cherry-picked a couple of commits from yjit_backend_ir to master 60c900f b4be3c0, hoping that the upstreaming PR will look less like a big-bang merge. Reordering commits could add some conflict resolution work and I'm sorry about that though.

@maximecb
Copy link

Let us know if you need help with anything Noah.

@noahgibbs
Copy link
Author

So far, so good.

Similarly, not too worried about some of it getting backported to master. It'll be fine.

Still untangling right now. You can see progress on noah_backend_rebase. Once that's done (Friday?), the main thing I'll want help with is a decision about how much commit-squashing is to be done. That should be pretty straightforward, though.

Somebody else could also look through test_yjit_new_backend.rb for usable bits and add them to another test file, come to think of it. I haven't started that yet and it doesn't depend on the rest of this task in any way.

@noahgibbs
Copy link
Author

noahgibbs commented Aug 25, 2022

Good progress today. I've rolled history forward to yjit_backend_ir latest, making sure things build and don't look too bad along the way (but not running most tests.) Commits are linearised and squashed, messages include URLs for PRs, etc.

This is all based on a 23rd August CRuby master (46c3a93). I'll roll it forward to a most-current. The branch is rebased onto f5f81bb, which is ruby/ruby's latest master commit as I write this.

After that, I'll start diffing our code to make sure I didn't include or exclude anything obviously incorrect, run tests, and fix up any problems I find while doing all that.

Things other people could now help with:

  • Weigh in on how much we want to squash non-PR commits. Anything in noah_backend_rebase with no number at the end of the first line of the commit message is a non-PR commit.
  • look at the tests, especially .cirrus.yml and test_yjit_new_backend.rb, to figure out what we want it to look like and whether we can scavenge anything useful from test_yjit_new_backend.
  • do we want to remove some/all of our changes to the test code in the old commits? Right now I've left it in. I'm not opposed to retroactively tearing it out. Leaving it in adds noise to the Git history, while tearing out the changes leaves a lot of failing tests if you check out old commits. Opinions?

But I think we're getting close.

@maximecb
Copy link

Good work Noah! :)

@k0kubun do you have bandwidth to help Noah with the upstreaming work? If so, you two could coordinate. You could pair and Noah could show you where he is at.

scavenge anything useful from test_yjit_new_backend.

I was thinking we should take inventory of what's test_yjit_new_backend.rb and if there's anything useful, merge them into test_yjit.rb. We probably do have a few useful regressions and corner case tests worth salvaging, but some if it is going to be someewhat duplicated.

do we want to remove some/all of our changes to the test code in the old commits?

What do you mean by remove our changes to the test code?

@noahgibbs
Copy link
Author

noahgibbs commented Aug 25, 2022

What do you mean by remove our changes to the test code?

For instance, we disable and re-enable the Ubuntu tests. We started by turning off a lot of standard tests, then slowly re-enabled them. In a lot of places, that'll cause churn in the files for those tests (e.g. stuff in .github/workflows, .cirrus.yml).

@maximecb
Copy link

What do you mean by remove our changes to the test code?

For instance, we disable and re-enable the Ubuntu tests. We started by turning off a lot of standard tests, then slowly re-enabled them. In a lot of places, that'll cause churn in the files for those tests (e.g. stuff in .github/workflows, .cirrus.yml).

Ok I see. Yes I think it would be good to remove those changes if we can to get a "cleaner" PR with less churn, but this can be lower on the priority list if you want since it probably wouldn't stop the PR from being merged.

@k0kubun
Copy link
Member

k0kubun commented Aug 25, 2022

Great work! It looks pretty close to the merge.

do you have bandwidth to help Noah with the upstreaming work? If so, you two could coordinate. You could pair and Noah could show you where he is at.

Yes, I'd be happy to. It'd be a lot of force-pushes, so coordination is certainly needed. I'll talk with Noah.

Things other people could now help with:

I'll help him on those items once he signs off for today.

@k0kubun
Copy link
Member

k0kubun commented Aug 25, 2022

  • Weigh in on how much we want to squash non-PR commits. Anything in noah_backend_rebase with no number at the end of the first line of the commit message is a non-PR commit.
  • look at the tests, especially .cirrus.yml and test_yjit_new_backend.rb, to figure out what we want it to look like and whether we can scavenge anything useful from test_yjit_new_backend.
  • do we want to remove some/all of our changes to the test code in the old commits? Right now I've left it in. I'm not opposed to retroactively tearing it out. Leaving it in adds noise to the Git history, while tearing out the changes leaves a lot of failing tests if you check out old commits. Opinions?

Looking at the commit messages, the history already doesn't look too bad. I'm thinking about doing the following.

  • As suggested by Maxime, remove diffs around temporary CI changes. Also, every diff in test_yjit_new_backend.rb should be redirected to test_yjit.rb, and leave it un-merged if duplicated. When it ends up making it an empty commit, remove it.
  • Try building each revision (at least on x86_64). When it fails, try building the next revision. If squashing helps removing the half-baked commit or you can fix it by changing how a git conflict is resolved, do it.
    • It's fine that some tests don't pass on Arm at first, but you should be able to build the interpreter at least, which is useful for git bisect, benchmarking, etc.

@k0kubun
Copy link
Member

k0kubun commented Aug 25, 2022

For each PR, make sure the Shopify/ruby PR URL is in the commit message (git filter-branch?)

I noticed that you did it by appending PR: https://github.com/Shopify/ruby/pull/123, which looks like a good format for commits that were not squash-merged.

For squash-merged ones with (#123) in the first line of the commit message, however, I think we should either remove it or just change it to (https://github.com/Shopify/ruby/pull/123) to avoid confusion and broken links on ruby/ruby. I don't have a strong preference on which one to choose, but for now I'll choose a non-removing option to make it look closer to yjit_backend_ir for comparison.

@k0kubun
Copy link
Member

k0kubun commented Aug 25, 2022

Here's the code I used for the link rewrite:

#!/usr/bin/env ruby
message = STDIN.read
if message.lines.first.match?(/\(#\d+\)\n\z/)
  message.sub!(/\(#(\d+)\)/, '(https://github.com/Shopify/ruby/pull/\1)')
  message.sub!(%r[\nPR: https://github\.com/Shopify/ruby/pull/\d+], '')
  message.chomp!
  puts message
else
  print message
end
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --msg-filter ~/tmp/filter.rb 881bc2a176..HEAD

@k0kubun
Copy link
Member

k0kubun commented Aug 25, 2022

To fix test code, it'd be useful to have a buildable YJIT in every revision, so I started working on it first. After the filter-branch, I added the following modifications to my branch (at 5fd3754a42 now), and now every revision is buildable on x86_64 🎉


I wrote the following script

commits = `git --no-pager log --date=iso --no-show-signature --pretty=format:'%h %Cgreen%ad %Cblue%an %Creset%s %C(blue)%d%Creset' 881bc2a176..k0kubun_backend_rebase`.lines.reverse
commits.each_with_index do |commit, index|
  puts "=" * 100
  puts "[#{index+1}/#{commits.size}] #{commit}"
  puts "=" * 100
  system("git checkout #{commit.split(" ").first}", exception: true)
  system("make -C .yjit-x86_64 -j8", exception: true)
end

and it ran successfully.

@k0kubun
Copy link
Member

k0kubun commented Aug 25, 2022

So I'm looking at this range 881bc2a...baf0d8b to look for temporary CI/test changes now.

We hadn't had the temporary workflow in the first 78 commits. Add temporary workflow to check new backend was the first commit that started doing the temporary testing.

It'd be difficult to manually list up commits touching temporary CI/tests from 159 commits, so I listed up such commits with a script:

lines = `git --no-pager log --date=iso --no-show-signature --pretty=format:'%h %Cgreen%ad %Cblue%an %Creset%s %C(blue)%d%Creset' 881bc2a176..k0kubun_backend_rebase`.lines.reverse
lines.each do |line|
  revision = line.split(" ", 2).first
  changed_files = `git diff #{revision}^ #{revision} --name-only`.lines.map(&:chomp)
  if changed_files.any? { |f| f == '.cirrus.yml' || f.start_with?('.github/') || f.start_with?('bootstraptest/') }
    puts line
  end
end

79 commits have been found. I'm gonna look into those commits.

Bare output of the script
1ec186a874 2022-07-08 17:41:12 -0400 Maxime Chevalier-Boisvert Add temporary workflow to check new backend (https://github.com/Shopify/ruby/pull/308)
69a8745456 2022-07-12 13:40:59 -0400 Maxime Chevalier-Boisvert Port YJIT New Backend Temp Checks to Cirrus (https://github.com/Shopify/ruby/pull/312)
456a821a7a 2022-07-20 15:00:42 -0400 Maxime Chevalier-Boisvert Port over setlocal_wc0
06abd8088a 2022-07-12 15:28:54 -0400 Maxime Chevalier-Boisvert Port over putstring
3254d53df2 2022-07-14 14:52:57 -0400 Maxime Chevalier-Boisvert Exclude X0 (C_RET_REG) from allocatable registers on arm (https://github.com/Shopify/ruby/pull/319)
89cfaff965 2022-07-14 16:51:01 -0400 Maxime Chevalier-Boisvert Port newhash, add tests for newhash, duphash
813a8ffcdd 2022-07-15 13:49:38 -0400 Maxime Chevalier-Boisvert Fix bug with LeaLabel on x86, add CI test
7987516682 2022-07-15 14:32:57 -0400 Maxime Chevalier-Boisvert Add --yjit-dump-insns test to Cirrus Arm workflow
6b3a8d167c 2022-07-15 16:21:35 -0400 Maxime Chevalier-Boisvert Update cirrus workflow
4ef770748c 2022-07-20 10:43:14 -0400 Maxime Chevalier-Boisvert Implement PosMarker instruction (https://github.com/Shopify/ruby/pull/328)
a6fb3c2a44 2022-07-20 14:50:00 -0400 Maxime Chevalier-Boisvert Refactor YJIT branches to use PosMarker (https://github.com/Shopify/ruby/pull/333)
0f500bb9d5 2022-07-20 15:07:59 -0400 Maxime Chevalier-Boisvert Add test for branchif
cceefe270a 2022-07-20 16:35:14 -0400 Maxime Chevalier-Boisvert Port over setlocal and getglobal
9097d91370 2022-07-20 16:43:19 -0400 Maxime Chevalier-Boisvert Port over newrange
07a849842f 2022-07-21 13:08:20 -0400 Maxime Chevalier-Boisvert Add two more small tests
b8d45b5cf4 2022-07-21 14:53:33 -0400 Maxime Chevalier-Boisvert Enable more btests in the CI workflows (https://github.com/Shopify/ruby/pull/334)
401d5d7339 2022-07-22 17:08:35 +0100 Noah Gibbs Port and test duparray and splatarray (https://github.com/Shopify/ruby/pull/337)
d29d172078 2022-07-22 12:26:59 -0400 Maxime Chevalier-Boisvert Enable more btests
4cda34652a 2022-07-22 14:01:21 -0400 Kevin Newton Fixes for AArch64 (https://github.com/Shopify/ruby/pull/338)
bd8b4b6a15 2022-07-22 16:13:29 -0400 Maxime Chevalier-Boisvert Fix CI workflows
664eee2579 2022-07-22 16:20:09 -0400 Maxime Chevalier-Boisvert Fix indentation that kept yaml from parsing. Fuck yaml.
729e4b3f0b 2022-07-22 16:25:37 -0400 Maxime Chevalier-Boisvert Test --yjit-stats in our CI workflows
7b574c7cf4 2022-07-25 15:38:09 +0100 Noah Gibbs Port and test checkkeyword (https://github.com/Shopify/ruby/pull/339)
4568c82b48 2022-07-25 15:22:25 -0400 Maxime Chevalier-Boisvert Fix a bug in the x86 backend wrt large integer values, enable more tests
a2bbf82483 2022-07-27 17:42:52 +0100 Noah Gibbs Port the YJIT defined opcode; fix C_ARG_REGS (https://github.com/Shopify/ruby/pull/342)
df5c10c2af 2022-07-27 14:31:41 -0400 Zack Deveau Port gen_checktype to the new IR assembler backend (https://github.com/Shopify/ruby/pull/343)
2b951eaae4 2022-08-01 10:16:01 -0700 Takashi Kokubun Port setglobal to the new backend (https://github.com/Shopify/ruby/pull/347)
c293e2cf0a 2022-08-01 10:34:15 -0700 Takashi Kokubun Port class variable instructions (https://github.com/Shopify/ruby/pull/346)
0bacb4e87e 2022-08-01 20:06:53 -0700 Takashi Kokubun Port only ATTRSET of opt_send_without_block (https://github.com/Shopify/ruby/pull/351)
8879278e63 2022-08-01 20:39:31 -0700 Takashi Kokubun Port anytostring, intern, and toregexp (https://github.com/Shopify/ruby/pull/348)
fb485bd2c1 2022-08-02 13:09:51 -0400 Zack Deveau Port gen_concatstring to new backend IR (https://github.com/Shopify/ruby/pull/350)
37a5a4ae49 2022-08-02 15:36:27 -0400 Maxime Chevalier-Boisvert Add 1 more allocatable reg on arm
4c522c8029 2022-08-02 13:14:36 -0700 Takashi Kokubun Improve the test coverage of getspecial
208788a1cb 2022-08-04 09:02:09 -0700 Takashi Kokubun Convert  getinstancevariable to new backend IR (https://github.com/Shopify/ruby/pull/352)
5cd3f1218a 2022-08-04 13:06:49 -0400 Maxime Chevalier-Boisvert Add list of btests we can't pass yet (as comments)
139941524b 2022-08-04 11:47:53 -0700 Takashi Kokubun Port gen_send_cfunc to the new backend (https://github.com/Shopify/ruby/pull/357)
a4baf83860 2022-08-03 18:25:01 -0400 Alan Wu Opnd::Value fixes (https://github.com/Shopify/ruby/pull/354)
871c57e8ee 2022-08-04 16:47:35 -0400 Maxime Chevalier-Boisvert Enable test_thread.rb on arm, now working
aea7e189a6 2022-08-04 16:46:36 -0400 Maxime Chevalier-Boisvert Fix block invalidation with new backend. Enable more btests on x86 (https://github.com/Shopify/ruby/pull/359)
9a59b9fdf7 2022-08-04 13:58:07 -0700 Takashi Kokubun Port send-only insns and write tests (https://github.com/Shopify/ruby/pull/360)
6be4a1211b 2022-08-05 08:21:52 -0700 Takashi Kokubun Port opt_mod to the new backend IR (https://github.com/Shopify/ruby/pull/363)
a5a0b3edfe 2022-08-05 08:47:09 -0700 Takashi Kokubun Port opt_minus, opt_or, and opt_and to the new IR (https://github.com/Shopify/ruby/pull/364)
8409393fce 2022-08-05 08:58:08 -0700 Takashi Kokubun Port setivar to the new backend IR (https://github.com/Shopify/ruby/pull/362)
f641146377 2022-08-05 09:18:34 -0400 Zack Deveau Port gen_opt_str_freeze to new backend IR (https://github.com/Shopify/ruby/pull/366)
03dd24085a 2022-08-05 13:32:16 -0400 Zack Deveau Port  opt_str_uminus to new backend IR (https://github.com/Shopify/ruby/pull/370)
f3929745ad 2022-08-05 10:47:35 -0700 Takashi Kokubun Port objtostring to the new backend (https://github.com/Shopify/ruby/pull/369)
40b25c2f83 2022-08-05 11:13:01 -0700 Takashi Kokubun Port opt_eq and opt_neq to the new backend (https://github.com/Shopify/ruby/pull/371)
952bbf4bf7 2022-08-05 11:37:51 -0700 Takashi Kokubun Port send to the new backend and test it (https://github.com/Shopify/ruby/pull/373)
7b16091c1c 2022-08-05 14:53:08 -0400 Maxime Chevalier-Boisvert Add more specific job names to yjit-new-backend workflow
c5bc19692a 2022-08-05 15:34:49 -0400 Maxime Chevalier-Boisvert Enable more btests that pass on x86 now that we have gen_send_cfunc (https://github.com/Shopify/ruby/pull/377)
a68bb2c92d 2022-08-05 17:09:22 -0400 Maxime Chevalier-Boisvert Enable btests now passing on arm (https://github.com/Shopify/ruby/pull/378)
d3cdb13044 2022-08-08 08:27:54 -0700 Takashi Kokubun Port invokebuiltin* insns to the new backend IR (https://github.com/Shopify/ruby/pull/375)
84f30d38ef 2022-08-08 18:42:42 -0400 Maxime Chevalier-Boisvert Enable test_insns.rb on arm
ef60ec3bd8 2022-08-09 10:38:48 -0400 Maxime Chevalier-Boisvert Enable test_ractor.rb on x86
9a413dbd49 2022-08-09 10:32:24 -0400 Maxime Chevalier-Boisvert Enable test_literal.rb and test_ractor.rb on arm
bdaf2b9e85 2022-08-09 09:16:27 -0700 Takashi Kokubun Port gen_send_iseq to the new backend IR (https://github.com/Shopify/ruby/pull/381)
274ae19e43 2022-08-09 10:01:20 -0700 Takashi Kokubun Port expandarray to the new backend IR (https://github.com/Shopify/ruby/pull/376)
26b32d187d 2022-08-09 16:03:39 -0400 Maxime Chevalier-Boisvert Try to run make -j in CI backend tests (https://github.com/Shopify/ruby/pull/386)
3411d7c618 2022-08-10 13:05:59 -0700 Takashi Kokubun Port the remaining method types in opt_send_without_block (https://github.com/Shopify/ruby/pull/390)
813fdfca52 2022-08-10 13:09:23 -0700 Takashi Kokubun Port invokesuper to the new backend IR (https://github.com/Shopify/ruby/pull/391)
f1febba100 2022-08-10 13:29:01 -0700 Takashi Kokubun Port getblockparamproxy and getblockparam (https://github.com/Shopify/ruby/pull/394)
451211868f 2022-08-10 16:38:42 -0400 Maxime Chevalier-Boisvert Handle out of memory tests (https://github.com/Shopify/ruby/pull/393)
7a04bad626 2022-08-10 14:01:21 -0700 Takashi Kokubun Port opt_aref and opt_aset to the new backend IR (https://github.com/Shopify/ruby/pull/387)
6c2b147687 2022-08-10 17:22:55 -0400 Alan Wu Fix code invalidation while OOM and OOM simulation (https://github.com/Shopify/ruby/pull/395)
741fccc4b4 2022-08-11 12:49:35 -0400 Zack Deveau Port opt_getinlinecache to the new backend (https://github.com/Shopify/ruby/pull/399)
8f50452d8c 2022-08-15 12:54:26 -0400 Maple Ong YJIT: Implement concatarray in yjit (https://github.com/Shopify/ruby/pull/405)
622645db72 2022-08-12 10:35:52 +0000 Noah Gibbs (and/or Benchmark CI) Port jit_rb_str_concat to new backend, re-enable cfunc lookup (https://github.com/Shopify/ruby/pull/402)
914b726e9f 2022-08-16 12:00:35 -0400 Maxime Chevalier-Boisvert Temporarily disable rb_str_concat, add CI tests (https://github.com/Shopify/ruby/pull/407)
922add7e44 2022-08-16 16:38:19 -0400 Maxime Chevalier-Boisvert Enable a few more test-all tests on x86
d24f01cae0 2022-08-17 12:23:59 -0400 Maxime Chevalier-Boisvert Fix issue with expandarray, add missing jl, enable tests (https://github.com/Shopify/ruby/pull/409)
173f314d29 2022-08-17 12:49:01 -0400 Maxime Chevalier-Boisvert Enable more tests on x86
4a8a1264a7 2022-08-17 15:42:39 -0400 Alan Wu Only check lowest bit for _Bool type (https://github.com/Shopify/ruby/pull/412)
51ddb32ed2 2022-08-17 16:20:42 -0400 Maxime Chevalier-Boisvert Enable test_gc on x86
733fd340f4 2022-08-18 07:49:27 -0700 Takashi Kokubun Avoid marking op_type on gen_defined (https://github.com/Shopify/ruby/pull/419)
0d5e66cf46 2022-08-18 13:00:54 -0700 Takashi Kokubun Run test-all with RUBY_YJIT_ENABLE=1 on CI (https://github.com/Shopify/ruby/pull/418)
74e1c6015c 2022-08-18 15:43:47 -0700 Takashi Kokubun Resurrect yjit-ubuntu workflow (https://github.com/Shopify/ruby/pull/427)
6ad743bf02 2022-08-19 14:00:28 -0700 Takashi Kokubun Run tests with --yjit-call-threshold=1 on arm64 (https://github.com/Shopify/ruby/pull/426)
ed80693e8f 2022-08-25 09:18:34 -0700 Takashi Kokubun Respect RUBY_TESTOPTS on test-all (https://github.com/Shopify/ruby/pull/435)
baf0d8b36e 2022-08-25 14:05:25 -0700 Takashi Kokubun Avoid randomizing the order of test-all on arm64 (https://github.com/Shopify/ruby/pull/440)  (HEAD -> k0kubun_backend_rebase, origin/k0kubun_backend_rebase)
List of commits with links
  • 1ec186a874 Maxime Chevalier-Boisvert Add temporary workflow to check new backend
  • 69a8745456 Maxime Chevalier-Boisvert Port YJIT New Backend Temp Checks to Cirrus
  • 456a821a7a Maxime Chevalier-Boisvert Port over setlocal_wc0
  • 06abd8088a Maxime Chevalier-Boisvert Port over putstring
  • 3254d53df2 Maxime Chevalier-Boisvert Exclude X0 (C_RET_REG) from allocatable registers on arm
  • 89cfaff965 Maxime Chevalier-Boisvert Port newhash, add tests for newhash, duphash
  • 813a8ffcdd Maxime Chevalier-Boisvert Fix bug with LeaLabel on x86, add CI test
  • 7987516682 Maxime Chevalier-Boisvert Add --yjit-dump-insns test to Cirrus Arm workflow
  • 6b3a8d167c Maxime Chevalier-Boisvert Update cirrus workflow
  • 4ef770748c Maxime Chevalier-Boisvert Implement PosMarker instruction
  • a6fb3c2a44 Maxime Chevalier-Boisvert Refactor YJIT branches to use PosMarker
  • 0f500bb9d5 Maxime Chevalier-Boisvert Add test for branchif
  • cceefe270a Maxime Chevalier-Boisvert Port over setlocal and getglobal
  • 9097d91370 Maxime Chevalier-Boisvert Port over newrange
  • 07a849842f Maxime Chevalier-Boisvert Add two more small tests
  • b8d45b5cf4 Maxime Chevalier-Boisvert Enable more btests in the CI workflows
  • 401d5d7339 Noah Gibbs Port and test duparray and splatarray
  • d29d172078 Maxime Chevalier-Boisvert Enable more btests
  • 4cda34652a Kevin Newton Fixes for AArch64
  • bd8b4b6a15 Maxime Chevalier-Boisvert Fix CI workflows
  • 664eee2579 Maxime Chevalier-Boisvert Fix indentation that kept yaml from parsing. Fuck yaml.
  • 729e4b3f0b Maxime Chevalier-Boisvert Test --yjit-stats in our CI workflows
  • 7b574c7cf4 Noah Gibbs Port and test checkkeyword
  • 4568c82b48 Maxime Chevalier-Boisvert Fix a bug in the x86 backend wrt large integer values, enable more tests
  • a2bbf82483 Noah Gibbs Port the YJIT defined opcode; fix C_ARG_REGS
  • df5c10c2af Zack Deveau Port gen_checktype to the new IR assembler backend
  • 2b951eaae4 Takashi Kokubun Port setglobal to the new backend
  • c293e2cf0a Takashi Kokubun Port class variable instructions
  • 0bacb4e87e Takashi Kokubun Port only ATTRSET of opt_send_without_block
  • 8879278e63 Takashi Kokubun Port anytostring, intern, and toregexp
  • fb485bd2c1 Zack Deveau Port gen_concatstring to new backend IR
  • 37a5a4ae49 Maxime Chevalier-Boisvert Add 1 more allocatable reg on arm
  • 4c522c8029 Takashi Kokubun Improve the test coverage of getspecial
  • 208788a1cb Takashi Kokubun Convert getinstancevariable to new backend IR
  • 5cd3f1218a Maxime Chevalier-Boisvert Add list of btests we can't pass yet (as comments)
  • 139941524b Takashi Kokubun Port gen_send_cfunc to the new backend
  • a4baf83860 Alan Wu Opnd::Value fixes
  • 871c57e8ee Maxime Chevalier-Boisvert Enable test_thread.rb on arm, now working
  • aea7e189a6 Maxime Chevalier-Boisvert Fix block invalidation with new backend. Enable more btests on x86
  • 9a59b9fdf7 Takashi Kokubun Port send-only insns and write tests
  • 6be4a1211b Takashi Kokubun Port opt_mod to the new backend IR
  • a5a0b3edfe Takashi Kokubun Port opt_minus, opt_or, and opt_and to the new IR
  • 8409393fce Takashi Kokubun Port setivar to the new backend IR
  • f641146377 Zack Deveau Port gen_opt_str_freeze to new backend IR
  • 03dd24085a Zack Deveau Port opt_str_uminus to new backend IR
  • f3929745ad Takashi Kokubun Port objtostring to the new backend
  • 40b25c2f83 Takashi Kokubun Port opt_eq and opt_neq to the new backend
  • 952bbf4bf7 Takashi Kokubun Port send to the new backend and test it
  • 7b16091c1c Maxime Chevalier-Boisvert Add more specific job names to yjit-new-backend workflow
  • c5bc19692a Maxime Chevalier-Boisvert Enable more btests that pass on x86 now that we have gen_send_cfunc
  • a68bb2c92d Maxime Chevalier-Boisvert Enable btests now passing on arm
  • d3cdb13044 Takashi Kokubun Port invokebuiltin* insns to the new backend IR
  • 84f30d38ef Maxime Chevalier-Boisvert Enable test_insns.rb on arm
  • ef60ec3bd8 Maxime Chevalier-Boisvert Enable test_ractor.rb on x86
  • 9a413dbd49 Maxime Chevalier-Boisvert Enable test_literal.rb and test_ractor.rb on arm
  • bdaf2b9e85 Takashi Kokubun Port gen_send_iseq to the new backend IR
  • 274ae19e43 Takashi Kokubun Port expandarray to the new backend IR
  • 26b32d187d Maxime Chevalier-Boisvert Try to run make -j in CI backend tests
  • 3411d7c618 Takashi Kokubun Port the remaining method types in opt_send_without_block
  • 813fdfca52 Takashi Kokubun Port invokesuper to the new backend IR
  • f1febba100 Takashi Kokubun Port getblockparamproxy and getblockparam
  • 451211868f Maxime Chevalier-Boisvert Handle out of memory tests
  • 7a04bad626 Takashi Kokubun Port opt_aref and opt_aset to the new backend IR
  • 6c2b147687 Alan Wu Fix code invalidation while OOM and OOM simulation
  • 741fccc4b4 Zack Deveau Port opt_getinlinecache to the new backend
  • 8f50452d8c Maple Ong YJIT: Implement concatarray in yjit
  • 622645db72 Noah Gibbs (and/or Benchmark CI) Port jit_rb_str_concat to new backend, re-enable cfunc lookup
  • 914b726e9f Maxime Chevalier-Boisvert Temporarily disable rb_str_concat, add CI tests
  • 922add7e44 Maxime Chevalier-Boisvert Enable a few more test-all tests on x86
  • d24f01cae0 Maxime Chevalier-Boisvert Fix issue with expandarray, add missing jl, enable tests
  • 173f314d29 Maxime Chevalier-Boisvert Enable more tests on x86
  • 4a8a1264a7 Alan Wu Only check lowest bit for _Bool type
  • 51ddb32ed2 Maxime Chevalier-Boisvert Enable test_gc on x86
  • 733fd340f4 Takashi Kokubun Avoid marking op_type on gen_defined
  • 0d5e66cf46 Takashi Kokubun Run test-all with RUBY_YJIT_ENABLE=1 on CI
  • 74e1c6015c Takashi Kokubun Resurrect yjit-ubuntu workflow
  • 6ad743bf02 Takashi Kokubun Run tests with --yjit-call-threshold=1 on arm64
  • ed80693e8f Takashi Kokubun Respect RUBY_TESTOPTS on test-all
  • baf0d8b36e Takashi Kokubun Avoid randomizing the order of test-all on arm64

@k0kubun
Copy link
Member

k0kubun commented Aug 26, 2022

As to the CI script, I'd say the current .cirrus.yml doesn't look too bad. Maybe we should stop saying it's "Temp Checks" (edit: filed #441), but it seems fine to do any other improvements after upstreaming. I'll clean up changes around x86_64 (GitHub Actions) though.

@k0kubun
Copy link
Member

k0kubun commented Aug 26, 2022

Commits with changes under .github/
  • 1ec186a874 Maxime Chevalier-Boisvert Add temporary workflow to check new backend
  • 813a8ffcdd Maxime Chevalier-Boisvert Fix bug with LeaLabel on x86, add CI test
  • b8d45b5cf4 Maxime Chevalier-Boisvert Enable more btests in the CI workflows
  • d29d172078 Maxime Chevalier-Boisvert Enable more btests
  • bd8b4b6a15 Maxime Chevalier-Boisvert Fix CI workflows
  • 664eee2579 Maxime Chevalier-Boisvert Fix indentation that kept yaml from parsing. Fuck yaml.
  • 729e4b3f0b Maxime Chevalier-Boisvert Test --yjit-stats in our CI workflows
  • 4568c82b48 Maxime Chevalier-Boisvert Fix a bug in the x86 backend wrt large integer values, enable more tests
  • 5cd3f1218a Maxime Chevalier-Boisvert Add list of btests we can't pass yet (as comments)
  • aea7e189a6 Maxime Chevalier-Boisvert Fix block invalidation with new backend. Enable more btests on x86
  • 7b16091c1c Maxime Chevalier-Boisvert Add more specific job names to yjit-new-backend workflow
  • c5bc19692a Maxime Chevalier-Boisvert Enable more btests that pass on x86 now that we have gen_send_cfunc
  • ef60ec3bd8 Maxime Chevalier-Boisvert Enable test_ractor.rb on x86
  • bdaf2b9e85 Takashi Kokubun Port gen_send_iseq to the new backend IR
  • 26b32d187d Maxime Chevalier-Boisvert Try to run make -j in CI backend tests
  • 451211868f Maxime Chevalier-Boisvert Handle out of memory tests
  • 914b726e9f Maxime Chevalier-Boisvert Temporarily disable rb_str_concat, add CI tests
  • 922add7e44 Maxime Chevalier-Boisvert Enable a few more test-all tests on x86
  • d24f01cae0 Maxime Chevalier-Boisvert Fix issue with expandarray, add missing jl, enable tests
  • 173f314d29 Maxime Chevalier-Boisvert Enable more tests on x86
  • 4a8a1264a7 Alan Wu Only check lowest bit for _Bool type
  • 51ddb32ed2 Maxime Chevalier-Boisvert Enable test_gc on x86
  • 0d5e66cf46 Takashi Kokubun Run test-all with RUBY_YJIT_ENABLE=1 on CI
  • 74e1c6015c Takashi Kokubun Resurrect yjit-ubuntu workflow

I finished removing changes under .github/ from the above commits. Here's the commits in the current branch: 881bc2a...eeddca5

@k0kubun
Copy link
Member

k0kubun commented Aug 26, 2022

I'll call it a day here. The only remaining effort would be to remove duplication between bootstraptest/test_yjit.rb and bootstraptest/test_yjit_new_backend.rb. Honestly, given the fact that we still have bootstrap/test_yjit_rust_port.rb, it's probably fine to do that later, but the commit history would look nicer without duplicated tests of course.

FYI, here's the list of 44 commits that touch bootstraptest/ (generated by the above script):

Commits touching bootstraptest/
  • 3cb619ca9f Maxime Chevalier-Boisvert Add temporary workflow to check new backend
  • 46d49124ce Maxime Chevalier-Boisvert Port over setlocal_wc0
  • 1b0e0f329f Maxime Chevalier-Boisvert Port over putstring
  • 8e88131076 Maxime Chevalier-Boisvert Exclude X0 (C_RET_REG) from allocatable registers on arm
  • a2fc07f804 Maxime Chevalier-Boisvert Port newhash, add tests for newhash, duphash
  • 97bc546793 Maxime Chevalier-Boisvert Refactor YJIT branches to use PosMarker
  • f27b957ef0 Maxime Chevalier-Boisvert Add test for branchif
  • 6462c0def7 Maxime Chevalier-Boisvert Port over setlocal and getglobal
  • a3bb7508d2 Maxime Chevalier-Boisvert Port over newrange
  • 01b42b0292 Maxime Chevalier-Boisvert Add two more small tests
  • 61474380a3 Noah Gibbs Port and test duparray and splatarray
  • 56b4ef1f14 Noah Gibbs Port and test checkkeyword
  • 8d6e16a9ff Noah Gibbs Port the YJIT defined opcode; fix C_ARG_REGS
  • 62e7c74af3 Zack Deveau Port gen_checktype to the new IR assembler backend
  • ea4b6e56a4 Takashi Kokubun Port setglobal to the new backend
  • a6edf3833d Takashi Kokubun Port class variable instructions
  • 44b53e317a Takashi Kokubun Port only ATTRSET of opt_send_without_block
  • 0d956c62d6 Takashi Kokubun Port anytostring, intern, and toregexp
  • 7215ce29eb Zack Deveau Port gen_concatstring to new backend IR
  • 76ee618750 Takashi Kokubun Improve the test coverage of getspecial
  • 19796e3a28 Takashi Kokubun Convert getinstancevariable to new backend IR
  • 370a9ae3f0 Takashi Kokubun Port gen_send_cfunc to the new backend
  • 6bd90b65dd Alan Wu Opnd::Value fixes
  • de1836d261 Maxime Chevalier-Boisvert Fix block invalidation with new backend. Enable more btests on x86
  • fd19b1b99d Takashi Kokubun Port send-only insns and write tests
  • 1d92fa4fc9 Takashi Kokubun Port opt_mod to the new backend IR
  • 58fe689cde Takashi Kokubun Port opt_minus, opt_or, and opt_and to the new IR
  • 43e872c165 Takashi Kokubun Port setivar to the new backend IR
  • c80aaf3636 Zack Deveau Port gen_opt_str_freeze to new backend IR
  • d1fdafa416 Zack Deveau Port opt_str_uminus to new backend IR
  • c29ae5bf6d Takashi Kokubun Port objtostring to the new backend
  • b972278bab Takashi Kokubun Port opt_eq and opt_neq to the new backend
  • 14bc6921a7 Takashi Kokubun Port send to the new backend and test it
  • b1379e0c80 Takashi Kokubun Port invokebuiltin* insns to the new backend IR
  • 1a0ba1ca71 Takashi Kokubun Port gen_send_iseq to the new backend IR
  • f4c7d6995e Takashi Kokubun Port expandarray to the new backend IR
  • ea0327d880 Takashi Kokubun Port the remaining method types in opt_send_without_block
  • ffb729e3c6 Takashi Kokubun Port invokesuper to the new backend IR
  • 03f6a4ca87 Takashi Kokubun Port getblockparamproxy and getblockparam
  • 932f327535 Takashi Kokubun Port opt_aref and opt_aset to the new backend IR
  • 0758530164 Alan Wu Fix code invalidation while OOM and OOM simulation
  • c05168c7b1 Zack Deveau Port opt_getinlinecache to the new backend
  • 6342a6c32b Maple Ong YJIT: Implement concatarray in yjit
  • fbfe6776e1 Noah Gibbs (and/or Benchmark CI) Port jit_rb_str_concat to new backend, re-enable cfunc lookup

@maximecb
Copy link

Looks pretty good Kokubun. Thanks for all the work you've put into this.

I just pushed 467f89d to remove ir_ssa.rs which is no longer use and now outdated.

@noahgibbs
Copy link
Author

noahgibbs commented Aug 26, 2022

This looks like great work. Thank you!

For squash-merged ones with (#123) in the first line of the commit message, however, I think we should either remove it or just change it to (#123) to avoid confusion and broken links on ruby/ruby. I don't have a strong preference on which one to choose, but for now I'll choose a non-removing option to make it look closer to yjit_backend_ir for comparison.

Yeah. I think we should remove it from the first line and just have the URL at the bottom. You're right, it gives bad links for ruby/ruby. It was useful for tracking the rebase, though!

@noahgibbs
Copy link
Author

noahgibbs commented Aug 26, 2022

I've started on the commits for test_yjit_new_backend.

@noahgibbs
Copy link
Author

(Sorry for the comments turning into headings in the details text)

Stuff from test_yjit_new_backend that potentially seem useful/different to me:
Line 352-372
# invokebuiltin
assert_equal '123', %q{
  def foo(obj)
    obj.foo = 123
  end
  struct = Struct.new(:foo)
  obj = struct.new
  foo(obj)
}

invokebuiltin_delegate

assert_equal '.', %q{
def foo(path)
Dir.open(path).path
end
foo(".")
}

opt_invokebuiltin_delegate_leave

assert_equal '[0]', %q{"\x00".unpack("c")}

Line 440-454

opt_send_without_block (VM_METHOD_TYPE_ISEQ)

assert_equal '1', %q{
def foo = 1
def bar = foo
bar
}
assert_equal '[1, 2, 3]', %q{
def foo(a, b) = [1, a, b]
def bar = foo(2, 3)
bar
}
assert_equal '[1, 2, 3, 4, 5, 6]', %q{
def foo(a, b, c:, d:, e: 0, f: 6) = [a, b, c, d, e, f]
def bar = foo(1, 2, c: 3, d: 4, e: 5)
bar
}
assert_equal '[1, 2, 3, 4]', %q{
def foo(a, b = 2) = [a, b]
def bar = foo(1) + foo(3, 4)
bar
}

Line 456-476

opt_send_without_block (VM_METHOD_TYPE_ISEQ)

assert_equal '1', %q{
def foo = 1
def bar = foo
bar
}
assert_equal '[1, 2, 3]', %q{
def foo(a, b) = [1, a, b]
def bar = foo(2, 3)
bar
}
assert_equal '[1, 2, 3, 4, 5, 6]', %q{
def foo(a, b, c:, d:, e: 0, f: 6) = [a, b, c, d, e, f]
def bar = foo(1, 2, c: 3, d: 4, e: 5)
bar
}
assert_equal '[1, 2, 3, 4]', %q{
def foo(a, b = 2) = [a, b]
def bar = foo(1) + foo(3, 4)
bar
}

Line 478-508

opt_send_without_block (VM_METHOD_TYPE_CFUNC)

assert_equal 'nil', %q{
def foo
nil.inspect # argc: 0
end
foo
}
assert_equal '4', %q{
def foo
2.pow(2) # argc: 1
end
foo
}
assert_equal 'aba', %q{
def foo
"abc".tr("c", "a") # argc: 2
end
foo
}
assert_equal 'true', %q{
def foo
respond_to?(:inspect) # argc: -1
end
foo
}
assert_equal '["a", "b"]', %q{
def foo
"a\nb".lines(chomp: true) # kwargs
end
foo
}

Line 623-628

checktype

assert_equal 'false', %q{
def function()
[1, 2] in [Integer, String]
end
function()
}

Line 672-694

anytostring, intern

assert_equal 'true', %q{
def foo()
:"#{true}"
end
foo()
}

toregexp, objtostring

assert_equal '/true/', %q{
def foo()
/#{true}/
end
foo().inspect
}

concatstrings, objtostring

assert_equal '9001', %q{
def foo()
"#{9001}"
end
foo()
}

@noahgibbs
Copy link
Author

I wrote:

I think we should remove it from the first line and just have the URL at the bottom

Ah, but you had done it the other way. Okay, I'm officially okay with either one ;-)

@noahgibbs
Copy link
Author

I've rebased from Kokubun's branch to move the tests we want to keep to test_yjit.rb, and pushed it as branch noah_backend_rebase again.

@noahgibbs
Copy link
Author

Nothing new in yjit_backend_ir. Sounds like we're basically okay on cirrus.yml. Looks like Kokubun already cleaned up the .github/workflows files?

So we may be good to open the ruby/ruby PR.

@k0kubun
Copy link
Member

k0kubun commented Aug 26, 2022

The branch looks great to me. Thank you for working on the test_yjit_new_backend portion. I'll do some final checks and then open a ruby/ruby PR.

@noahgibbs
Copy link
Author

Perfect. Thanks!

@k0kubun
Copy link
Member

k0kubun commented Aug 26, 2022

I finished checking what I wanted to check https://shopify.slack.com/archives/C019MPFLWHY/p1661536712906259.

Next, I'll merge Alan's PR as the final patch, merge it to your branch, fix its PR link, rebase it from the latest master, run yjit-bench, and finally, file a ruby/ruby PR.

@noahgibbs
Copy link
Author

At this point, any further work will take place in the ruby/ruby PR. Closing.

We do still need to cherry-pick one more PR into the ruby/ruby PR (#437). But we'll do that there, not here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants