The LBC-bench website for leaderboards and project information.
- LBC-bench Website
This is the codebase for the LBC-bench website, which showcases leaderboards for the LBC-bench benchmark. LBC-bench provides performance data for generation and comprehension of HDLs on design problems by AI models and agents. The initial focus is on the results generated by the Comprehensive Verilog Design Problems (CVDP) benchmark.
The site is built using:
- Jinja2 for HTML templating
- Pure CSS (organized in modular files)
- Vanilla JavaScript for interactivity
- Python for the build process
The site is statically generated and can be hosted on GitHub Pages or any other static hosting service.
- Python 3.8 or higher
uvfor Python package management
-
Clone this repository:
https://github.com/si2org/LBC-bench cd LBC-bench -
Install dependencies (uv will automatically create and manage the virtual environment):
make install
-
Build the site:
make build
-
Start a local development server:
make serve
-
Open your browser and navigate to http://localhost:8000
.
├── build.py # Build script that generates the static site
├── CNAME # Domain configuration for GitHub Pages
├── css/ # CSS files organized by functionality
│ ├── components.css # Styles for UI components
│ ├── core.css # Core styling variables and base styles
│ ├── layout.css # Layout-related styles
│ ├── main.css # CSS entry point that imports all stylesheets
│ ├── pages.css # Page-specific styles
│ └── utilities.css # Utility classes
├── data/ # Data files used in the site generation
│ └── leaderboards.json # Leaderboard data
├── dist/ # Generated static site (created by build.py)
├── favicon.ico # Site favicon
├── img/ # Image assets
├── js/ # JavaScript files
│ ├── citation.js # Citation functionality
│ ├── citationFormat.js # Citation format handlers
│ ├── mainResults.js # Main leaderboard functionality
│ ├── tableByRepo.js # Repository filter functionality
│ ├── tableByYear.js # Year filter functionality
│ └── viewer.js # Results viewer functionality
├── Makefile # Automation for common tasks
├── pyproject.toml # Python project configuration and dependencies
└── templates/ # Jinja2 templates
├── base.html # Base template with common structure
├── _leaderboard_table.html # Reusable leaderboard table component
├── _sidebar.html # Sidebar component
└── pages/ # Page-specific templates
├── citations.html
├── contact.html
├── index.html
├── lite.html
├── multimodal.html
├── submit.html
└── viewer.html
The website is built using a static site generator implemented in build.py. This script:
- Loads templates from the
templatesdirectory - Loads data from
data/leaderboards.json - Renders each template in
templates/pages/to a corresponding HTML file indist/ - Copies static assets (CSS, JS, images, favicon, etc.) to the
dist/directory
The website uses Jinja2 for templating:
templates/base.html: The main template that defines the site structuretemplates/_sidebar.html: The sidebar component included in the base templatetemplates/_leaderboard_table.html: The reusable leaderboard table componenttemplates/pages/*.html: Individual page templates that extend the base template
Templates use Jinja2 syntax for:
- Template inheritance (
{% extends 'base.html' %}) - Including components (
{% include "_sidebar.html" %}) - Block definitions and overriding (
{% block content %}{% endblock %}) - Variable rendering (
{{ variable }}) - Control structures (
{% if condition %}{% endif %})
The leaderboard data follows a specific flow from JSON to rendered HTML:
-
Data Source: All leaderboard data is stored in
data/leaderboards.json. This JSON file contains an array of leaderboards under the key"leaderboards", with each leaderboard having a"name"(e.g., "code-generation-limited-context", etc.) and a list of"results"entries. -
Data Loading: During the build process in
build.py, the JSON file is loaded and passed to the Jinja2 templates as theleaderboardsvariable:# From build.py with open(ROOT / "data/leaderboards.json", "r") as f: leaderboards = json.load(f) # Passed to templates during rendering html = tpl.render( title="LBC-bench", leaderboards=leaderboards["leaderboards"] )
-
Reusable Table Component: The
_leaderboard_table.htmltemplate is a reusable component that loops through the leaderboards array and renders a table for each one:{% for leaderboard in leaderboards %} <div class="tabcontent" id="leaderboard-{{leaderboard.name}}"> <table class="table scrollable data-table"> <!-- Table headers --> <tbody> {% for item in leaderboard.results if not item.warning %} <tr> <!-- Row data from each result item --> </tr> {% endfor %} </tbody> </table> </div> {% endfor %} -
Page-Specific Rendering: In page templates like
lite.html, the leaderboard data can be rendered in a more focused way by filtering for a specific leaderboard:{% for leaderboard in leaderboards %} {% if leaderboard.name == "Lite" %} <table class="table scrollable data-table"> <!-- Only renders the "Lite" leaderboard --> </table> {% endif %} {% endfor %} -
Dynamic Badges and Formatting: The templates add special badges and formatting to entries:
- Medal emoji (🥇, 🥈, 🥉) for the top 3 entries
- "New" badge (🆕) for recent submissions
- "Open source" badge (🤠) when
item.ossis true - "Verified" checkmark (✅) when
item.verifiedis true - Percentage formatting with 2 decimal places:
{{ "%.2f"|format(item.resolved|float) }}
-
JavaScript Enhancements: After the HTML is rendered, JavaScript files like
mainResults.js,tableByRepo.js, andtableByYear.jsenhance the tables with sorting, filtering, and tab switching functionality.
This modular approach allows for easy updates to leaderboard data - simply modify the JSON file, and the changes will propagate throughout the site during the next build.
CSS is organized into modular files and imported through main.css:
core.css: Base styles, variables, and resetslayout.css: Grid and layout componentscomponents.css: UI component stylespages.css: Page-specific stylesutilities.css: Utility classes for common styling needs
This organization makes it easy to find and update specific styles.
JavaScript is used for interactive features:
mainResults.js: Main leaderboard functionality including filtering and sortingtableByRepo.js&tableByYear.js: Additional table filteringcitation.js&citationFormat.js: Citation formatting and copyingviewer.js: Results viewer page functionality
To add a new page to the website:
- Create a new HTML file in
templates/pages/, e.g.,templates/pages/new-page.html - Start with the basic template structure:
{% extends 'base.html' %} {% block title %}New Page Title{% endblock %} {% block content %} <section class="container"> <div class="content-section"> <h2>Your New Page</h2> <p>Content goes here...</p> </div> </section> {% endblock %} - Add any page-specific CSS to
css/pages.css - Add any page-specific JavaScript to the
js/directory and include it in your template:{% block js_files %} <script src="js/your-script.js"></script> {% endblock %} - Update the sidebar navigation in
templates/_sidebar.htmlto include your new page - Rebuild the site with
make build
To update the leaderboard data, please see the README_CONTRIBUTOR.md.
To customize the visual appearance:
-
Main color variables are defined in
css/core.css:- Edit color variables to change the overall color scheme
- Update typography variables to change fonts
-
Layout structures are in
css/layout.css:- Modify container sizes, grid layouts, etc.
-
Component styling is in
css/components.css:- Update button styles, card styles, table styles, etc.
-
To add dark mode styles, look for
.dark-modeselectors throughout the CSS files
When adding new features:
- Avoid directly modifying existing code; extend it instead
- Add new CSS in an appropriate file based on its purpose
- Add new JavaScript files for new functionality
- Update templates to include new components
- Maintain the existing structure and coding style
The website is designed to be deployed to GitHub Pages:
- Build the site with
make build - Commit and push changes to the GitHub repository under the
mainormasterbranch - Configure the domain to serve from the
gh-pagesbranch (root directory) in your repository settings - The domain is configured via the
CNAMEfile and the GitHub repository settings
See deploy.yml for the GitHub Actions workflow that handles automatic deployment to GitHub Pages.
Common issues:
- Build fails: Make sure you have all dependencies installed with
make install - CSS changes not appearing: Check if you're editing the correct CSS file and if it's imported in
main.css. Force refresh the page (Cmd+Shift+R) if changes aren't showing. - JavaScript not working: Check browser console for errors and ensure your script is included in the template
- Template changes not appearing: Make sure you're building the site after making changes with
make build.make servealso builds the site automatically.