// ─────── PORTFOLIO DATA ───────
const DATA = {
  name: 'Love Sahajbir Singh',
  handle: 'love.sahaj',
  tagline: 'ML infrastructure engineer. The systems that stay up so the models can ship.',
  location: 'Edinburgh, Scotland',
  email: 'lovesahaj@outlook.com',
  github: 'github.com/lovesahaj',
  linkedin: 'linkedin.com/in/lovesahaj',

  summary:
    'Software engineer with ~3 years building the infrastructure that ML runs on. Currently pursuing an M.Sc. in Computer Science at the University of Edinburgh, focused on distributed systems, reinforcement learning, and the plumbing underneath ML.',

  metrics: [
    {
      big: '30',
      unit: '%',
      label: 'Late hospital checkout rate after the escalation service shipped (down from ~95%)',
      tag: 'PROD',
    },
    {
      big: '24',
      unit: '×',
      label: 'Faster Verilog generation with a topological-sort compiler (4 min → 10 s)',
      tag: 'COMPILED',
    },
    {
      big: '10k',
      unit: '+',
      label: 'Daily mobile users on the AWS Lambda routing service I designed',
      tag: 'SCALED',
    },
    {
      big: '41',
      unit: '%',
      label: 'pass@10 on held-out coding eval after RLVR fine-tuning of Qwen3-1.7B (0% baseline)',
      tag: 'TRAINED',
    },
  ],

  projects: [
    {
      id: 'zigton',
      name: 'zigton (Tile-based GPU Kernel DSL)',
      stack: ['Zig', 'LLVM IR', 'PTX', 'CUDA Driver API', 'NVPTX'],
      blurb:
        "A Triton-inspired GPU kernel DSL built entirely in Zig: write tile-level kernels (one block owns one tile) with no separate compiler, lowering Zig comptime through LLVM IR to PTX embedded in the host binary.",
      highlights: [
        "Designed a **tile-based programming model** where one GPU block owns one tile, abstracting thread-to-lane mapping so kernels read at tile level instead of per-thread.",
        'Built a **Zig to LLVM IR to PTX** compilation pipeline targeting NVPTX, with automatic PTX module loading and host-side execution via the CUDA Driver API.',
        'Implemented validated tile operations including tail-safe load/store and tile arithmetic (tile+scalar, tile+tile), with five tested kernels (vector_add, fill, add_scalar, and more).',
      ],
      link: 'https://github.com/lovesahaj/zigton',
      year: '2026',
    },
    {
      id: 'rlvr-codegen',
      name: 'RLVR Code Generation Pipeline',
      stack: ['Python', 'PyTorch', 'GRPO', 'LoRA', 'sandboxing'],
      blurb:
        'An RLVR/GRPO training pipeline for code generation with sandboxed parallel reward execution. Fine-tuned Qwen3-1.7B on verifiable coding problems; held-out eval went from 0% to 17% pass@1 and 41% pass@10.',
      highlights: [
        'Designed an **RLVR/GRPO training pipeline** for code generation supporting LoRA fine-tuning, checkpoint resumption, execution-based rewards, and held-out pass@k evaluation from a single config.',
        'Implemented a **sandboxed parallel reward executor**: process isolation, timeout enforcement, AST/format-level reward shaping, and whitespace-normalised test comparison across N workers.',
        'Fine-tuned Qwen/Qwen3-1.7B on PrimeIntellect/verifiable-coding-problems; held-out eval went from **0% (base model) to 17% pass@1 and 41% pass@10** on a 100-problem slice.',
      ],
      links: [
        { label: 'gitlab', url: 'https://gitlab.com/lovesahaj1225/leetcode-rlvr' },
        { label: 'hugging face', url: 'https://huggingface.co/lovesahaj/qwen3-1.7b-rlvr-codegen' },
      ],
      link: 'https://gitlab.com/lovesahaj1225/leetcode-rlvr',
      year: '2026',
    },
    {
      id: 'hybrid-search',
      name: 'Hybrid Code Search Engine',
      stack: ['Rust', 'Axum', 'PostgreSQL', 'pgvector', 'GCP', 'Terraform', 'PyO3'],
      blurb:
        'A hybrid BM25 + semantic search API combining PostgreSQL full-text search with pgvector via Reciprocal Rank Fusion, served from Rust/Axum and deployed on GCP Cloud Run.',
      highlights: [
        'Wrote a shared tokenizer as a Rust library with **PyO3/maturin bindings** to keep tokenisation consistent across the Rust serving API and the Python offline indexer, eliminating train/serve skew.',
        'Built a **hybrid BM25 + semantic search** API in Rust/Axum using PostgreSQL full-text search, pgvector, and Reciprocal Rank Fusion; deployed on GCP Cloud Run via Terraform.',
        'Implemented a recursive-descent parser for boolean queries with proximity search #(a, b, n), phrase grouping, implicit AND insertion, and synonym expansion.',
      ],
      link: 'https://github.com/kllrv-cw-3/hybrid-search-engine',
      year: '2026',
    },
    {
      id: 'rl-jax',
      name: 'JAX Control & RL Benchmark Suite',
      stack: ['JAX', 'Python', 'RL', 'Control'],
      blurb:
        'A JAX benchmark harness for CartPole covering LQR, iLQR, MPC, Q-learning, SARSA, Monte Carlo control, and Deep Q-learning under a shared cost/reward interface.',
      highlights: [
        'Built a **JAX benchmark harness** for CartPole covering LQR, iLQR, MPC, Q-learning, SARSA, Monte Carlo control, and Deep Q-learning under a shared cost/reward interface.',
        'Implemented **nonlinear iLQR/MPC** with jax.jit, lax.scan, vmap, Jacobians, and Hessians; MPC achieved **90% stability**, **39× lower cost**, and **>200× smoother control** versus LQR.',
      ],
      link: 'https://github.com/lovesahaj/rl-jax',
      year: '2026',
    },
    {
      id: 'prime',
      name: 'Distributed Prime Finder',
      stack: ['Go', 'Distributed Systems', 'DFS', 'Chandy-Lamport'],
      blurb:
        'A coordinator/worker distributed system for prime generation with fault tolerance via Chandy-Lamport snapshotting and DFS-backed checkpointing.',
      highlights: [
        'Co-designed a **coordinator/worker** distributed system with fault tolerance via **Chandy-Lamport snapshotting** and DFS-backed checkpointing.',
        'Implemented work distribution, N-way merge aggregation across workers, and recovery from worker failures mid-computation.',
      ],
      links: [
        { label: 'coordinator', url: 'https://github.com/ADKRL/prime-coordinator' },
        { label: 'worker', url: 'https://github.com/ADKRL/prime-worker' },
      ],
      link: 'https://github.com/ADKRL/prime-coordinator',
      year: '2025',
    },
    {
      id: 'raytracer',
      name: 'C++20 Multi-threaded Raytracer',
      stack: ['C++20', 'BVH', 'Multithreading', 'Blender'],
      blurb:
        'A C++20 raytracer with BVH acceleration and a thread-pool scheduler, supporting reflection, refraction, depth of field, and motion blur.',
      highlights: [
        'Built a C++20 raytracer using **BVH acceleration** and a thread-pool work scheduler, supporting reflection, refraction, depth of field, and motion blur.',
        'Integrated Blender scene exports with a composite BRDF shading model (Lambertian diffuse + Blinn-Phong specular).',
      ],
      link: 'https://github.com/lovesahaj/raytracer',
      year: '2025',
    },
  ],

  experience: [
    {
      role: 'Software Development Engineer II',
      org: 'Max Healthcare',
      dates: 'Sep 2024 - Aug 2025',
      loc: 'Gurgaon, India',
      bullets: [
        'Built a scheduled doctor-escalation service processing hospital-wide operational data every 15 minutes to detect overloaded hospitals and delayed doctors; reduced late patient checkout rate from **~95% to ~30%** across the network.',
        'Designed a Node.js/Express routing service on AWS Lambda + API Gateway bridging an in-house API framework to a legacy backend; serves mobile app traffic for **~10k daily users** with auth, retries, and structured logging.',
        'Built a FastAPI appointment-request service (500+ daily users) with SQS-backed update fan-out, EventBridge cron reminders, and TTL-based auto-rejection for expired requests.',
      ],
    },
    {
      role: 'Software Development Engineer',
      org: 'Infineon Technologies',
      dates: 'Jan 2023 - Aug 2024',
      loc: 'Bangalore, India',
      bullets: [
        'Implemented a topological-sort expression compiler that lowered model constructs into Verilog, cutting generation time from **4 minutes to 10 seconds** (~24× speedup) on the team\'s largest IP designs.',
        'Built a pytest + coverage.py framework integrated with Jenkins and SonarQube, raising central-repository test coverage from **36% to 80%** and gating merges on coverage regressions.',
        'Built a schematic-visualisation tool with hot reload, replacing a manual rebuild loop and used daily by IP design engineers for debugging.',
        'Implemented a simulation framework for FPGA clock/power constraints, automating power-frequency limit analysis across multiple voltage/clock domains.',
      ],
    },
    {
      role: 'Summer Research Intern',
      org: 'IIRS / ISRO',
      dates: 'Jun 2022 — Jul 2022',
      loc: 'Dehradun, India',
      bullets: [
        'Applied Super-Resolution models (SRGAN, ESRGAN, RedNet) to enhance Landsat imagery on open-source datasets.',
        'Utilized object-detection pipelines (Faster-RCNN, RetinaNet) to classify aircraft and foliage in satellite imagery.',
      ],
    },
    {
      role: 'Research Intern',
      org: 'Indian Institute of Information Technology, Ropar',
      dates: 'Nov 2021 — Feb 2022',
      loc: 'Ropar, India',
      bullets: [
        'Developed deep-learning models for COVID-19 percentage estimation via medical imaging with Dr. Puneet Goyal.',
      ],
    },
  ],

  education: [
    {
      school: 'University of Edinburgh',
      degree: 'M.Sc. Computer Science',
      dates: 'Sep 2025 — Present',
      extra: 'Distributed Systems, NLP, CG Rendering, Text Tech for DS, ML Systems, Robotics & RL',
    },
    {
      school: 'Dr. B.R. Ambedkar NIT, Jalandhar',
      degree: 'B.Tech. Information Technology',
      dates: 'Jul 2019 — May 2023',
      extra: 'GPA 8.04 / 10',
    },
  ],

  now: [
    {
      title: 'M.Sc. at Edinburgh',
      body: 'Taking Distributed Systems and ML Systems coursework. Writing more Rust and Zig than is strictly reasonable. Currently working on my Dissertation.',
      tag: 'edinburgh',
    },
    {
      title: 'zigton (GPU DSL)',
      body: "Building a tile-based GPU kernel DSL in Zig. Triton's programming model, Zig's comptime, no separate compiler. Currently at the toolchain-spike stage.",
      tag: 'zig',
    },
    {
      title: 'Reading',
      body: 'Going deep on reinforcement learning and ML systems. RL infra, training pipelines, and the systems papers underneath.',
      tag: 'learning',
    },
    {
      title: 'Looking for',
      body: 'Full-time ML infrastructure, backend, and distributed systems roles, starting September 2026. UK work rights via the Graduate Route, no sponsorship needed. Remote-EMEA or UK.',
      tag: 'open-to-work',
    },
  ],

  skills: [
    { k: 'Expertise', v: ['Backend', 'ML/AI', 'Cloud Infra', 'DevOps'], hot: 0 },
    {
      k: 'Languages',
      v: ['Python', 'Rust', 'C/C++', 'Go', 'Java', 'Julia', 'JavaScript', 'Shell'],
      hot: [0, 1],
    },
    {
      k: 'Tools',
      v: [
        'PyTorch',
        'FastAPI',
        'Django',
        'LangGraph',
        'LangChain',
        'OpenCV',
        'Docker',
        'PostgreSQL',
        'gRPC',
        'RAGs',
        'Git',
        'Terraform',
        'Linux',
      ],
      hot: [0, 1, 2, 6, 7, 11],
    },
  ],
};

// sections as "buffers"
const BUFFERS = [
  { id: 'projects', file: 'projects.md', glyph: '', key: '1' },
  { id: 'experience', file: 'experience.md', glyph: '', key: '2' },
  { id: 'about', file: 'about.md', glyph: '', key: '3' },
  { id: 'now', file: 'now.md', glyph: '', key: '4' },
  { id: 'writing', file: 'writing.md', glyph: '', key: '5' },
  { id: 'contact', file: 'contact.md', glyph: '', key: '6' },
];

window.DATA = DATA;
window.BUFFERS = BUFFERS;
