{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/18678","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/18678/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/18678/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/18678/events","html_url":"https://github.com/dotnet/coreclr/issues/18678","id":336409775,"node_id":"MDU6SXNzdWUzMzY0MDk3NzU=","number":18678,"title":"JIT: possibly revisit how we set assertion prop table size","user":{"login":"AndyAyersMS","id":10121823,"node_id":"MDQ6VXNlcjEwMTIxODIz","avatar_url":"https://avatars1.githubusercontent.com/u/10121823?v=4","gravatar_id":"","url":"https://api.github.com/users/AndyAyersMS","html_url":"https://github.com/AndyAyersMS","followers_url":"https://api.github.com/users/AndyAyersMS/followers","following_url":"https://api.github.com/users/AndyAyersMS/following{/other_user}","gists_url":"https://api.github.com/users/AndyAyersMS/gists{/gist_id}","starred_url":"https://api.github.com/users/AndyAyersMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndyAyersMS/subscriptions","organizations_url":"https://api.github.com/users/AndyAyersMS/orgs","repos_url":"https://api.github.com/users/AndyAyersMS/repos","events_url":"https://api.github.com/users/AndyAyersMS/events{/privacy}","received_events_url":"https://api.github.com/users/AndyAyersMS/received_events","type":"User","site_admin":false},"labels":[{"id":196940911,"node_id":"MDU6TGFiZWwxOTY5NDA5MTE=","url":"https://api.github.com/repos/dotnet/coreclr/labels/area-CodeGen","name":"area-CodeGen","color":"d4c5f9","default":false},{"id":172143005,"node_id":"MDU6TGFiZWwxNzIxNDMwMDU=","url":"https://api.github.com/repos/dotnet/coreclr/labels/enhancement","name":"enhancement","color":"1d76db","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/coreclr/milestones/5","html_url":"https://github.com/dotnet/coreclr/milestone/5","labels_url":"https://api.github.com/repos/dotnet/coreclr/milestones/5/labels","id":1328081,"node_id":"MDk6TWlsZXN0b25lMTMyODA4MQ==","number":5,"title":"Future","description":"Milestone tracking issues not triaged to a planned release. Work in this milestone may happen, or may not: it is not committed.","creator":{"login":"joshfree","id":1302850,"node_id":"MDQ6VXNlcjEzMDI4NTA=","avatar_url":"https://avatars1.githubusercontent.com/u/1302850?v=4","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":1410,"closed_issues":1245,"state":"open","created_at":"2015-09-29T00:26:07Z","updated_at":"2018-06-29T15:12:47Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-06-27T22:28:42Z","updated_at":"2018-06-29T20:04:16Z","closed_at":null,"author_association":"MEMBER","body":"Some data on how often we drop assertions (from investigations into #18327, via pmi over fx):\r\n\r\nTable Size | Num Methods | Avg Assertion Count | Methods with Dropped Assertions \r\n----- | -------: | --------: | ----:\r\n64 | 159493 | 4.6 | 222\r\n128 | 1801 | 42.3 | 28\r\n256 | 237 | 81.2 | 4\r\n\r\nOverall this doesn't seem too bad -- only about 0.16% of methods lost assertions from table size limits. I unfortunately didn't track how many of the size 64 cases were ones where we deliberately limited the size for throughput reasons.\r\n\r\nTable size is determined by looking at `compILCodeSize` which will not take additions from inlining into account (among other things). So it seems like we perhaps could find a better size predictor.\r\n\r\nOr perhaps just allow the table to grow? \r\n\r\nHere's a breakdown of how many methods would fit into our existing size bins:\r\n\r\nAssertion Count | Methods \r\n--- | ----:\r\n0 - 64  |  161835 \r\n65 - 128 | 585 \r\n129 - 256 | 104 \r\n more than 256 | 21\r\n\r\nMax number of assertions seen was 615 (in a method that used a size 64 table), in `Microsoft.CodeAnalysis.VisualBasic.VisualBasicCommandLineParser:Parse(ref,ref,ref,ref):ref:this`. So 551 of these were dropped.\r\n\r\nThere is obviously some consideration of the overall cost of the subsequent dataflow analysis too, which is roughly proportional to max assertion size * number of blocks. So if we allow max assertion size to scale up with blocks we potentially see some quadratic behavior. But this seems perhaps solvable too -- we generate all (or more) assertions initially, and then only limit the ones we use if we see bad scaling.\r\n\r\nThis might let us also try and prioritize which assertions should survive, though I don't have any particular idea yet how to formulate that (something like the value number equivalent of weighted ref count usage ...?).\r\n\r\nNote today we actually generate all assertions. Assertion gen doesn't early out once the table is full (though perhaps it should). It just stops recording assertions once the table fills up. So we are already paying the cost of finding all these assertions. And the table size itself is not a burden\r\n\r\nSo a rough proposal would be to find and record all assertions -- allowing the table to grow larger (with perhaps some size limit) and have a budget based on blocks * assertions, and, if over budget, start trimming assertions somehow to get under budget.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/401459899","html_url":"https://github.com/dotnet/coreclr/issues/18678#issuecomment-401459899","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/18678","id":401459899,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTQ1OTg5OQ==","user":{"login":"erozenfeld","id":10624223,"node_id":"MDQ6VXNlcjEwNjI0MjIz","avatar_url":"https://avatars2.githubusercontent.com/u/10624223?v=4","gravatar_id":"","url":"https://api.github.com/users/erozenfeld","html_url":"https://github.com/erozenfeld","followers_url":"https://api.github.com/users/erozenfeld/followers","following_url":"https://api.github.com/users/erozenfeld/following{/other_user}","gists_url":"https://api.github.com/users/erozenfeld/gists{/gist_id}","starred_url":"https://api.github.com/users/erozenfeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erozenfeld/subscriptions","organizations_url":"https://api.github.com/users/erozenfeld/orgs","repos_url":"https://api.github.com/users/erozenfeld/repos","events_url":"https://api.github.com/users/erozenfeld/events{/privacy}","received_events_url":"https://api.github.com/users/erozenfeld/received_events","type":"User","site_admin":false},"created_at":"2018-06-29T20:04:16Z","updated_at":"2018-06-29T20:04:16Z","author_association":"MEMBER","body":"@dotnet/jit-contrib "}}
{"actor":{"display_login":"erozenfeld"}}