nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: compiler-explorer/compiler-explorer
Pull request #7606 (2025-04-24 19:59:41)

Fix the embedded iframe buttons. Note to future selves: try and avoid…
… styles as code indicators ... mea culpa



Patch:
diff --git a/static/sharing.ts b/static/sharing.ts
index bd11f06d2..fe4f38056 100644
--- a/static/sharing.ts
+++ b/static/sharing.ts
@@ -387,7 +387,7 @@ export class Sharing {
             case LinkType.Embed: {
                 const options: Record<string, boolean> = {};
                 $('#sharelinkdialog input:checked').each((i, element) => {
-                    options[$(element).prop('class')] = true;
+                    options[$(element).data('option')] = true;
                 });
                 done(null, Sharing.getEmbeddedHtml(config, root, false, options), false);
                 return;
diff --git a/views/popups/sharelinkdialog.pug b/views/popups/sharelinkdialog.pug
index 672d69fe2..4114b4cc2 100644
--- a/views/popups/sharelinkdialog.pug
+++ b/views/popups/sharelinkdialog.pug
@@ -16,10 +16,10 @@
               small.form-text.text-muted#share-permalink-help Use this URL to share your code with others
               #embedsettings.mb-3(role="group")
                 .form-check
-                  input.form-check-input.readOnly(type="checkbox" id="share-checkbox-readonly")
+                  input.form-check-input(type="checkbox" id="share-checkbox-readonly" data-option="readOnly")
                   label.form-check-label(for="share-checkbox-readonly") Read Only
                 .form-check
-                  input.form-check-input.hideEditorToolbars(type="checkbox" id="share-checkbox-hideEditorToolbars")
+                  input.form-check-input(type="checkbox" id="share-checkbox-hideEditorToolbars" data-option="hideEditorToolbars")
                   label.form-check-label(for="share-checkbox-hideEditorToolbars") Hide Editor Toolbars
               if sharingEnabled
                 .socialsharing.mt-2


Test patch:
diff --git a/docs/TestingTheUi.md b/docs/TestingTheUi.md
index cbc29714e..7e9461a72 100644
--- a/docs/TestingTheUi.md
+++ b/docs/TestingTheUi.md
@@ -20,7 +20,7 @@ major UI changes, framework updates, or when implementing significant new featur
 - Test the copy button
 - Check that social sharing buttons display correctly
 - Verify proper styling in both light and dark themes
-- Check the `<iframe>` of embed is correct HTML
+- Check the `<iframe>` of embed is correct HTML, including its various options
 - Check the inner link of the iframe for embed works still (that is, embed mode)
 - Test "Copied to clipboard" tooltip functionality
Repository: compiler-explorer/compiler-explorer
Pull request #7146 (2024-11-28 16:15:29)

Move site-templates loader file
File doesn't have anything to do with the http server anymore


Patch:
diff --git a/lib/handlers/api/site-template-controller.ts b/lib/handlers/api/site-template-controller.ts
index 38a5703f3..cc9ccca7b 100644
--- a/lib/handlers/api/site-template-controller.ts
+++ b/lib/handlers/api/site-template-controller.ts
@@ -24,7 +24,7 @@
 
 import express from 'express';
 
-import {getSiteTemplates} from '../site-templates.js';
+import {getSiteTemplates} from '../../site-templates.js';
 
 import {HttpController} from './controller.interfaces.js';
 
diff --git a/lib/handlers/site-templates.ts b/lib/site-templates.ts
similarity index 96%
rename from lib/handlers/site-templates.ts
rename to lib/site-templates.ts
index f65c54298..56068a1af 100644
--- a/lib/handlers/site-templates.ts
+++ b/lib/site-templates.ts
@@ -27,7 +27,7 @@ import path from 'node:path';
 
 import _ from 'underscore';
 
-import {SiteTemplatesType} from '../../types/features/site-templates.interfaces.js';
+import {SiteTemplatesType} from '../types/features/site-templates.interfaces.js';
 
 let siteTemplates: SiteTemplatesType;
 


Test patch:
diff --git a/test/handlers/site-templates-tests.ts b/test/handlers/site-templates-tests.ts
index 2a0ad2e19..c1875add4 100644
--- a/test/handlers/site-templates-tests.ts
+++ b/test/handlers/site-templates-tests.ts
@@ -3,7 +3,7 @@ import request from 'supertest';
 import {beforeAll, describe, expect, it} from 'vitest';
 
 import {SiteTemplateController} from '../../lib/handlers/api/site-template-controller.js';
-import {getSiteTemplates} from '../../lib/handlers/site-templates.js';
+import {getSiteTemplates} from '../../lib/site-templates.js';
 
 describe('Site Templates Backend', () => {
     let app: express.Express;
Repository: compiler-explorer/compiler-explorer
Pull request #7257 (2025-01-09 23:05:23)

Handle sponsor cases with items that need to be shown every time better
I really don't like the solution but it works for this case and lets us add a few more sponsors before it all breaks.


Patch:
diff --git a/lib/sponsors.ts b/lib/sponsors.ts
index e4c96c954..7c14a5fcd 100644
--- a/lib/sponsors.ts
+++ b/lib/sponsors.ts
@@ -107,8 +107,9 @@ export function makeIconSets(
         const toPick = icons.map(icon => {
             return {
                 icon: icon,
-                // Number of times we'd expect to see this, divided by number of times we saw it
-                error: result.length / icon.topIconShowEvery / (sponsorAppearanceCount.get(icon) || 0.00001),
+                // Number of times we'd expect to see this, divided by number of times we saw it, assuming that we pick
+                // this one next.
+                error: (result.length + 1) / icon.topIconShowEvery / ((sponsorAppearanceCount.get(icon) || 0) + 1),
             };
         });
         toPick.sort((lhs, rhs) => rhs.error - lhs.error);


Test patch:
diff --git a/test/sponsors-test.ts b/test/sponsors-test.ts
index 8b1236f82..f878b241e 100644
--- a/test/sponsors-test.ts
+++ b/test/sponsors-test.ts
@@ -226,6 +226,23 @@ levels:
         ]);
         expect(() => makeIconSets(icons, 2)).toThrow();
     });
+    it('should pick icons appropriately when one is required every time and the others fit in ok every 3', () => {
+        const sponsor1 = parse({name: 'Sponsor1', topIconShowEvery: 1, icon: '1'});
+        const sponsor2 = parse({name: 'Sponsor2', topIconShowEvery: 3, icon: '2'});
+        const sponsor3 = parse({name: 'Sponsor3', topIconShowEvery: 3, icon: '3'});
+        const sponsor4 = parse({name: 'Sponsor4', topIconShowEvery: 3, icon: '4'});
+        const sponsor5 = parse({name: 'Sponsor5', topIconShowEvery: 3, icon: '5'});
+        const sponsor6 = parse({name: 'Sponsor6', topIconShowEvery: 3, icon: '6'});
+        const icons = [sponsor1, sponsor2, sponsor3, sponsor4, sponsor5, sponsor6];
+        expect(makeIconSets(icons, 10)).toEqual([icons]);
+        expect(makeIconSets(icons, 3)).toEqual([
+            [sponsor1, sponsor2, sponsor3],
+            [sponsor1, sponsor4, sponsor5],
+            [sponsor1, sponsor2, sponsor6],
+            [sponsor1, sponsor3, sponsor4],
+            [sponsor1, sponsor5, sponsor6],
+        ]);
+    });
 });
 
 describe('Our specific sponsor file', () => {
Repository: compiler-explorer/compiler-explorer
Pull request #7266 (2025-01-12 19:11:18)

[rust] switch to `-C debuginfo=2`
This is mainly for `pahole`, which requires type information that is only present with `-C debuginfo=2`:
https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo

CE originally passed `-g` to `rustc` (which is an alias for `-C debuginfo=2`), but this was changed in c4411ff2a135893b13d49a65c7da613caa93d6ba to `-C debuginfo=1` to work around https://github.com/rust-lang/rust/issues/11906. However, this workaround never actually removed frame pointers, so switching back to `-C debuginfo=2` should not affect codegen for very old `rustc` versions. See also #79.


Patch:
diff --git a/lib/compilers/rust.ts b/lib/compilers/rust.ts
index 0d70412c1..4e28546ba 100644
--- a/lib/compilers/rust.ts
+++ b/lib/compilers/rust.ts
@@ -247,7 +247,7 @@ export class RustCompiler extends BaseCompiler {
     }
 
     override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: string, userOptions?: string[]) {
-        let options = ['-C', 'debuginfo=1', '-o', this.filename(outputFilename)];
+        let options = ['-C', 'debuginfo=2', '-o', this.filename(outputFilename)];
 
         const userRequestedEmit = _.any(unwrap(userOptions), opt => opt.includes('--emit'));
         if (filters.binary) {


Test patch:
diff --git a/test/base-compiler-tests.ts b/test/base-compiler-tests.ts
index 6da95af7e..a54c865e8 100644
--- a/test/base-compiler-tests.ts
+++ b/test/base-compiler-tests.ts
@@ -856,7 +856,7 @@ describe('Rust overrides', () => {
         );
         expect(originalOptions).toEqual([
             '-C',
-            'debuginfo=1',
+            'debuginfo=2',
             '-o',
             'output.txt',
             '--crate-type',
@@ -870,6 +870,6 @@ describe('Rust overrides', () => {
                     value: 'aarch64-linux-something',
                 },
             ]),
-        ).toEqual(['-C', 'debuginfo=1', '-o', 'output.txt', '--crate-type', 'bin', '-Clinker=/usr/aarch64/bin/gcc']);
+        ).toEqual(['-C', 'debuginfo=2', '-o', 'output.txt', '--crate-type', 'bin', '-Clinker=/usr/aarch64/bin/gcc']);
     });
 });